Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File in use
Message
De
17/10/2001 19:57:32
 
 
À
17/10/2001 15:16:53
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Divers
Thread ID:
00569634
Message ID:
00569989
Vues:
28
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform