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:
01034340
Views:
23
>Is there an API call that determines if any certain file type is being in used?

You can use FOPEN.
lcFileName = GETFILE()
lnFH = FOPEN(lcFileName, 12)
IF lnFH > 0
=FCLOSE(lnFH)
* Ok to work with the file
ELSE
* The file is open somewhere exclusively
ENDIF


Thanks for the reply. These code works well if I have only one File. But my case, its four types of files, e.g. doc, xls, dat, filemaker data.. I had consult the help file and stumbled on the FOPEN API Routine but its not applicable to me..

I dont want to restart automatically the server with administrative logon enabled every day for security reasons, users dont have acces to file server, (But can read and wright to those files, funny , no pen drives allowed, no diskettes. Only thing is object access auditing is enabled at File Server.) files are sensitive and confidential... just to solve my backup problem.
Jojo R. dela Cuesta, B.Sc.
eConsultant, Programmer
Dalplus Technologies
http://www.dalplus.com
Previous
Reply
Map
View

Click here to load this message in the networking platform