Skip to content

Commit

Permalink
remove workaround in #40310 (#46154)
Browse files Browse the repository at this point in the history
  • Loading branch information
lewing committed Dec 16, 2020
1 parent 87ae256 commit 8e913a2
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,19 +361,6 @@ public static void MoveDirectory(string sourceFullPath, string destFullPath)
throw new IOException(SR.Format(SR.IO_AlreadyExists_Name, destFullPath));
}

#if TARGET_BROWSER
// renaming a file doesn't return correct error code on emscripten if one of the parent paths does not exist,
// manually workaround it for now (https://github.com/dotnet/runtime/issues/40305)
if (!Directory.Exists(Path.GetDirectoryName(sourceFullPath)))
{
throw new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, sourceFullPath));
}
if (!Directory.Exists(Path.GetDirectoryName(destFullPath)))
{
throw new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, destFullPath));
}
#endif

if (Interop.Sys.Rename(sourceFullPath, destFullPath) < 0)
{
Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo();
Expand Down

0 comments on commit 8e913a2

Please sign in to comment.