Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best approach to verify for exclusivity of a file
Message
From
08/08/2011 16:33:06
John Baird
Coatesville, Pennsylvania, United States
 
 
To
08/08/2011 15:30:00
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01520429
Message ID:
01520443
Views:
80
This message has been marked as a message which has helped to the initial question of the thread.
>>Sorry for wrong suggestion.
>
>No problem, it seems it is also the same one as Al mentioned. This is exactly the process we are doing. But, before going into a Try Catch, I wanted to verify if there could be a more fancy approach.


You can try to open the file for exclusive read :
Stream stream = File.Open(myfileName, FileMode.Open, FileAccess.read, FileShare.None);
if an error you'll receive an ioexception....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform