Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is the file in use?
Message
De
25/01/2007 17:09:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01189394
Message ID:
01189400
Vues:
7
I think that FILE() is what I was looking for. I simply forgot about it. Thx Jake.

>This is from the help entry for FOPEN():
>
>IF FILE('errors.txt')  && Does file exist?
>   gnErrFile = FOPEN('errors.txt',12)  && If so, open read-write
>ELSE
>   gnErrFile = FCREATE('errors.txt')  && If not, create it
>ENDIF
>IF gnErrFile < 0  && Check for error opening file
>   WAIT 'Cannot open or create output file' WINDOW NOWAIT
>ELSE  && If no error, write to file
>   =FWRITE(gnErrFile, 'Error information to be written here')
>ENDIF
>=FCLOSE(gnErrFile)  && Close file
>MODIFY FILE errors.txt NOWAIT  && Open file in edit window
>
>
>This could be slightly modified to give you what you're looking for.
>
>>I have a table with file names in in.
>>
>>Is there a way to know if a file is opened?
>>
>>Will I have to use fclose or fcreate?
>>
>>What I'm hoping for (solution) is something like the following
>>
>>
>>If TheFileIsOpen( lcNameOfTheFile)
>>   .
>>   .
>>   .
>>else
>>   .
>>   .
>>   .
>>endif
>>
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform