I am trying to copy a file between two UNC paths to which I have full access. The root of each UNC is a different physical drive. I can use file explorer to copy the file with no problem.
string file1 = @"\\node\disk1\dir\file.jpg";
string file2 = @"\\node\disk2\dir\file.jpg";
File.Copy(file1,file2);
The above fails with a DirectoryNotFoundException
.
However - this works fine, but it is too slow to be usable and indicates that it is not a permission issue.
Image img = Image.FromFile(file1);
img.Save(file2);
If the files are on the same physical device \node\disk1 then the File.Copy works fine.