I guess it depends on the kind of file. Some files can be opened with FOPEN() some need to be open with the actual program they are associated with. But in most cases if you are trying to open a file that is already opened by another user VFP will throw an error that you can trap. Mike Gagnon
If you want to get the best response to a question, please check out FAQ184-2483 first.
Another way to find out if a file is in use is to try to rename it to itself, like:
RENAME myfile.dat TO myfile.dat
If VFP returns an error then the file is in use. I use this method when copying customer files from an FTP site by an automated process. Some files are rather large and my automated script runs every 15 minutes. If it can rename the file to itself, then the file is copied. If it can't, then it sleeps for 15 minutes and tries again.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.