Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit fb0cbae

Browse files
authored
Make File.Move copy when the file system doesn't support link (#27371)
1 parent fb17ad8 commit fb0cbae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/System.IO.FileSystem/src/System/IO/FileSystem.Unix.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public static void MoveFile(string sourceFullPath, string destFullPath)
101101
if (errorInfo.Error == Interop.Error.EXDEV || // rename fails across devices / mount points
102102
errorInfo.Error == Interop.Error.EPERM || // permissions might not allow creating hard links even if a copy would work
103103
errorInfo.Error == Interop.Error.EOPNOTSUPP || // links aren't supported by the source file system
104-
errorInfo.Error == Interop.Error.EMLINK) // too many hard links to the source file
104+
errorInfo.Error == Interop.Error.EMLINK || // too many hard links to the source file
105+
errorInfo.Error == Interop.Error.ENOSYS) // the file system doesn't support link
105106
{
106107
CopyFile(sourceFullPath, destFullPath, overwrite: false);
107108
}

0 commit comments

Comments
 (0)