Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to tell if file is open exclusively ?
Message
From
15/05/2001 09:52:38
 
 
To
15/05/2001 09:43:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00503929
Message ID:
00507250
Views:
16
>Hello Alejandro
>
>This function works with any file not just a dbf.
>
>
>
>	* Function returns true if file or table can be locked for writing
>	Func LOCKABLE
>	Lparam lcFile
>	Local lcRetval,liHandle
>	lcRetval=.f.
>	liHandle=fopen(lcFile,12)
>	If liHandle>0
>		lcRetval=.t.
>		=fclose(liHandle)
>	Endif
>	Return lcRetval
>
>
>
>


This does not reliably work. The only reliable way to tell if a file is open exclusively is to try to USE it exclusively and then trap the error.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform