Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine if a file or documents is in used?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01034302
Message ID:
01034331
Views:
17
>Is there an API call that determines if any certain file type is being in used?
There is no need of API:


LOCAL lcFullPathName, lhFile

lcFullPathName = "c:\YourDir\YourFile.TXT"
lhFile = FOPEN(lcFullPathName, 12) && Read-Write Access
IF lhFile < 0
**** Someone uses this file
ELSE
**** No one uses the file
FCLOSE(lhFile)
ENDIF
>>

Thanks for the reply.. I didn't make it clear, Some files cannot be access/read during backup procedure from a File server. I get file is opened on the backup program log files. It seems that still lock not by the application but by the Network Operating System. All users of an application exited and shutdown their PC. Backing up still not successfull. Any API calls to determined whether the OS has lock a certain file? Currently Im using the Windows Backup Utility. Veritas very $$$?

I had created a small backup utility that will backup a whole directory of their important files daily and instructed that in order for my program do its task, they must close all open files from the server and shutdown their PC when going home.

But then how can I deploy my simple app if even the MS Backup Utility cannot backup all files from the file server? Restarting the file server solves my problem but dont want to do that. Our client has no IT staff, they just depending on us.

Any help please?
Jojo R. dela Cuesta, B.Sc.
eConsultant, Programmer
Dalplus Technologies
http://www.dalplus.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform