Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8232092: (fs) Files::isWritable returns false on a writeable root dir…
…ectory (win)

Reviewed-by: alanb
  • Loading branch information
nhat-nguyen authored and Alan Bateman committed Oct 7, 2020
1 parent 5a9bd41 commit abe2593
Show file tree
Hide file tree
Showing 2 changed files with 483 additions and 1 deletion.
Expand Up @@ -82,7 +82,12 @@ static WindowsFileStore create(WindowsPath file) throws IOException {
try {
return createFromPath(target);
} catch (WindowsException e) {
if (e.lastError() != ERROR_DIR_NOT_ROOT)
// GetVolumePathName might return the following error codes
// when the drives were created using `subst`.
// Try expanding the path again in such cases.
if (e.lastError() != ERROR_DIR_NOT_ROOT &&
e.lastError() != ERROR_INVALID_PARAMETER &&
e.lastError() != ERROR_DIRECTORY)
throw e;
target = WindowsLinkSupport.getFinalPath(file);
if (target == null)
Expand Down

1 comment on commit abe2593

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on abe2593 Oct 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.