The File.Move(source, dest) and FileInfo.MoveTo(dest) functions do not currently function as they should with regards to overwrites. The following test passes on Windows, but fails on Linux:
FileInfo testFileSource = new FileInfo(GetTestFilePath());
testFileSource.Create().Dispose();
FileInfo testFileDest = new FileInfo(GetTestFilePath());
testFileDest.Create().Dispose();
Assert.Throws<IOException>(() => File.Move(testFileSource.FullName, testFileDest.FullName)); // doesn't throw on Ubuntu
The File.Move(source, dest) and FileInfo.MoveTo(dest) functions do not currently function as they should with regards to overwrites. The following test passes on Windows, but fails on Linux: