Skip to content

Commit

Permalink
Fix renameTo function on Windows
Browse files Browse the repository at this point in the history
Fixes #9995

RELNOTES: None
PiperOrigin-RevId: 274772226
  • Loading branch information
meteorcloudy authored and copybara-github committed Oct 15, 2019
1 parent 8d0ae20 commit 3a43b09
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ public boolean delete(Path path) throws IOException {
}
}

@Override
public void renameTo(Path sourcePath, Path targetPath) throws IOException {
// Make sure the target path doesn't exist to avoid permission denied error on Windows.
targetPath.delete();
super.renameTo(sourcePath, targetPath);
}

@Override
protected void createSymbolicLink(Path linkPath, PathFragment targetFragment) throws IOException {
Path targetPath =
Expand Down

0 comments on commit 3a43b09

Please sign in to comment.