Why is it that File.Move(sourceFileName, destFileName)
works fine when the source file and destination files are in different partitions, but Directory.Move(sourceDirName, destDirName)
don't? It throws
System.IO.IOException: "Source and destination path must have
identical roots. Move will not work across volumes."
I even tried to create a DirectoryInfo
instance and use the MoveTo(destDirName)
method but without success.
Am I missing something? Do I really have to implement a "move" functionality myself? (the directory I want to move is very large btw).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…