Skip to content

Commit

Permalink
Remove sourceFullPath from Unix FileSystem.MoveDirectory exception (d…
Browse files Browse the repository at this point in the history
…otnet#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
  • Loading branch information
steveberdy committed Jul 16, 2021
1 parent 405da67 commit fb2e673
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public static void Move(string sourceDirName, string destDirName)
if (!FileSystem.DirectoryExists(fullsourceDirName) && !FileSystem.FileExists(fullsourceDirName))
throw new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, fullsourceDirName));

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath)
// On Windows we end up with ERROR_INVALID_NAME, which is
// "The filename, directory name, or volume label syntax is incorrect."
//
// This surfaces as a IOException, if we let it go beyond here it would
// This surfaces as an IOException, if we let it go beyond here it would
// give DirectoryNotFound.

if (Path.EndsInDirectorySeparator(sourceFullPath))
Expand All @@ -405,7 +405,7 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath)
case Interop.Error.EACCES: // match Win32 exception
throw new IOException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, sourceFullPath), errorInfo.RawErrno);
default:
throw Interop.GetExceptionForIoErrno(errorInfo, sourceFullPath, isDirectory: true);
throw Interop.GetExceptionForIoErrno(errorInfo, isDirectory: true);
}
}
}
Expand Down

0 comments on commit fb2e673

Please sign in to comment.