Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File in use
Message
From
17/10/2001 19:57:32
 
 
To
17/10/2001 15:16:53
General information
Forum:
Visual Basic
Category:
Other
Title:
Miscellaneous
Thread ID:
00569634
Message ID:
00569989
Views:
27
>Thanks, but this is not working.
>Let me explain want I want to do.
>I have a bunch of files from differents folders that I want to copy.
>But, before copying thoses files, I want to check if anyone of theses file is in use.
>So this way, I can copy all the files.
>If I don't check, only the file that where not in use would be copyied...
>Basically, it's like a transaction and if an error occurs, I want to roll back the transaction.
>And, even if the file is open, I can still "re-open it" from VB.
>So, does anybody know a function, API, or way to check if a file is in
>use.
>
>Patrice Merineau

Even if you have the API that can check this, you will still have the same issue since it wouldn't do it for all the files you need to copy. If you need to rollback any copies if one file copy fails then just save the copied file names along with its destination so that you can remove them if one of them failed.

Or, check the files first and abort the processing if any one of them returns that it is open. This would have the drawback that a file that has been checked can be opened while the rest of the files are tested and thus the copy of that one will fail. Looks like a tricky one, let us know how it works out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform