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 14:48:24
 
 
To
08/08/2011 14:37:28
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:
01520432
Views:
61
This message has been marked as a message which has helped to the initial question of the thread.
>What would be the best approach to verify for exclusivity of a file? I need to make sure a file is available before attempting a move.

I think in the final analysis you have to just try to move it, wrapped in a TRY...CATCH.

You might be thinking:

1. Check if anyone else is using the file
2. If not, move it

But, someone else could start using the file between 1 and 2. Yes, the time span between 1 and 2 may be small, and the chance of that happening low, but it could happen.
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