Information générale
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Network:
Windows 2003 Server
>>Doesn't neccessarily rule out a threading issue - depends what triggers the call to the method containing the MoveTo (a file watcher for example)
>
>The Robot.exe (the desktop application) includes a reference to Framework.dll, which does the MoveTo(). A few lines a command later, still in Robot.exe, a verification is made to see if the file exist. As surprisingly as it gets, the file no longer exist. So, the MoveTo() succeeded but the file is seen has not being there. The verification of the existence of the file is done by using DirectoryInfo(). This file exist verification is done intensively throughout the entire set of applications supported. So, I doubt there would be something in there that would conflict with the recognition of the file.
>
>>Out of curiosity:
>>Are you using MoveTo to move the file to a different partition or drive ?
>>Does this tend to happen with larger files?
>
>The MoveTo() moves the file from the same drive/logical disks. It is in fact under the same directory branch. We move it from one level to another.
>
>The file size varies from 20 KB to 20 MB approximately.
My understanding is that when Windows moves a file to another folder on the same partition it simply modifies the path so the size of file should not be a factor.
If you are using DirectoryInfo() then you could try calling it's Refresh() method before checking for the existence of the moved file.
But it is still not clear to me what triggers the call to MoveTo() - as before, if this is an event (such as using Filewatcher) then you could have re-entrant code.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement