Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting Locked Files
Message
From
18/10/2005 19:05:12
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01059899
Message ID:
01060106
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
Fundamentally, I'm not sure there is any other way to do it. If you call some IsItLocked() function and it returns False, by the time you try to open the file someone else may have locked it. You either get the lock or you don't.

>Hilmar,
>
>I've been looking through the help and this does indeed appear to be the way it should be done. :( I'm not too crazy about this solution, but I guess I'll use it.
>
>Thanks,
>Chad
>
>>I assume that if the file is used somewhere else, the code to open it would produce an error. A simple solution might then be to use a try - catch block.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform