I am using standard File.Copy(source,dest,true) method in C# and I have
problem with copying large number of files.
Here is my code:
foreach (FileInfo file in files)
{
File.Copy(file.FullName,destPath+ "\\" + file.Name, true);
}
This code copies only 5 or 10 files but in "files" collection there is 60
files.
I copy files over local network.
I think that this code (File.Copy) calls
Win32Native.CopyFile(fullPathInternal, dst, !overwrite))
and after that it runs again if foreach but coping is not finished.
After large number requests is send File.Copy is not finished for all files.
Is there a way to get response after File.Copy operation is finished?
Thanks
Radenko