c# - File.Copy() sync or asycn? -


I am using the file. To copy the code (source, destination, true) from local to remote overwrite option. In my case, Dest is a mapped network drive:

  file. Copy (source, destination, true); UnMapDrive (); // Unmap network drive  

The problem I have is that the source file may be locked so that I will not be able to remove the file from the local.

I think this may be due to the file. Copy () The call is not certain whether it syncs a process or not. In other words, what is the source file released after the call?

Yes, it is issued and file. Copy method prevents execution until the copy operation is complete.

The file may be available for reading, but may be locked for deletion.

Check with what process the source file is locking.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -