Skip to content

Commit fb2e673

Browse files
authored
Remove sourceFullPath from Unix FileSystem.MoveDirectory exception (dotnet#55658)
* Update Path.Windows.cs * Change helper method to internal Switched method from a private protection level to an internal protection level. Also removed trailing whitespace. * Removed sourceFullPath from Unix FileSystem.MoveDirectory thrown exception * Undo commit from main fork branch * Revert FileSystem.Windows.cs changes
1 parent 405da67 commit fb2e673

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libraries/System.Private.CoreLib/src/System/IO/Directory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public static void Move(string sourceDirName, string destDirName)
288288
if (!FileSystem.DirectoryExists(fullsourceDirName) && !FileSystem.FileExists(fullsourceDirName))
289289
throw new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, fullsourceDirName));
290290

291-
if (!sameDirectoryDifferentCase // This check is to allowing renaming of directories
291+
if (!sameDirectoryDifferentCase // This check is to allow renaming of directories
292292
&& FileSystem.DirectoryExists(fulldestDirName))
293293
throw new IOException(SR.Format(SR.IO_AlreadyExists_Name, fulldestDirName));
294294

src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Unix.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath)
380380
// On Windows we end up with ERROR_INVALID_NAME, which is
381381
// "The filename, directory name, or volume label syntax is incorrect."
382382
//
383-
// This surfaces as a IOException, if we let it go beyond here it would
383+
// This surfaces as an IOException, if we let it go beyond here it would
384384
// give DirectoryNotFound.
385385

386386
if (Path.EndsInDirectorySeparator(sourceFullPath))
@@ -405,7 +405,7 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath)
405405
case Interop.Error.EACCES: // match Win32 exception
406406
throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, sourceFullPath), errorInfo.RawErrno);
407407
default:
408-
throw Interop.GetExceptionForIoErrno(errorInfo, sourceFullPath, isDirectory: true);
408+
throw Interop.GetExceptionForIoErrno(errorInfo, isDirectory: true);
409409
}
410410
}
411411
}

0 commit comments

Comments
 (0)