General information
Category:
Coding, syntax and commands
Environment versions
Network:
Windows 2003 Server
>>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.
>
>Ok
>
>>If you are using DirectoryInfo() then you could try calling it's Refresh() method before checking for the existence of the moved file.
>
>The DirectoryInfo() object is created after the MoveTo(). Are you suggesting that it might be possible that by the time I use that command that it cannot see the file yet because it has been called too fast after the MoveTo()?
No (although you may be right if MoveTo() is async), if DirectoryInfo() is instantiated after the MoveTo() then presumably the Refresh() would not help.
>>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.
>
>I am not sure what the question is. This is simply VB.NET code.
But events are still events :-}
If the method containing the MoveTo() is triggered by an event then it's possible that a new call will tread on an existing one with obvious consequences. If that's a possibility then putting a lock on the method might be a solution.....
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only