Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is the file in use?
Message
From
25/01/2007 17:09:50
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01189394
Message ID:
01189400
Views:
6
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é
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform