Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to close file opened with FOPEN() after abnormal ter
Message
 
À
08/07/2005 07:09:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01030321
Message ID:
01030332
Vues:
13
>>>I am accessing a file with FOPEN().
>>>
>>>During development if there is an abnormal termination procedure cannot be run again because file is in use. How do I close that file if I no longer have the file handle?
>>
>>According to HELP
>>CLOSE ALL also closes low-level files.
>
>Thanks Borislav. Is there another way other than the nuclear option? That would totally reset the development environment.

You can log FOPEN to some text files. Unfortunately you must put the first 3 lines everywhere you have FOPEN, or if you use some global header file put them in it:
IF _VFP.StartMode == 0
#define FOPEN FOPENEX
ENDIF

? FOPEN("d:\all_zapl\path.ini",12)


FUNCTION FOPENEX(lcFileName, lnMode)
  LOCAL lnHandle
  lnMode = IIF(TYPE("lnMode") # "N",0,lnMode)
  lnHandle = FOPE(lcFileName, lnMode) && Don't put the full name of FOPEN here
  STRTOFILE(lcFileName+"~"+TRANSFORM(lnHandle),"d:\openedhandles.txt")
RETURN lnHandle
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform