Skip to content

Commit

Permalink
Make set{Executable,Readable} noops in WindowsFileSystem
Browse files Browse the repository at this point in the history
Windows does not have the concept of readable or executable files, so these calls would eventually end up in noop calls. Making them noops right away skips an unnecessary existence check.

Closes bazelbuild#18005.

PiperOrigin-RevId: 523398137
Change-Id: I6f40f9bff94524a73cfa2f01a674bc086a845e23
  • Loading branch information
fmeum authored and copybara-github committed Apr 11, 2023
1 parent 79aac2e commit 805c8f0
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,18 @@ protected boolean isDirectory(PathFragment path, boolean followSymlinks) {
return super.isDirectory(path, followSymlinks);
}

@Override
protected void setReadable(PathFragment path, boolean readable) {
// Windows does not have a notion of readable files.
// https://github.com/openjdk/jdk/blob/e52a2aeeacaeb26c801b6e31f8e67e61b1ea2de3/src/java.base/windows/native/libjava/WinNTFileSystem_md.c#L473-L476
}

@Override
protected void setExecutable(PathFragment path, boolean executable) {
// Windows does not have a notion of executable files.
// https://github.com/openjdk/jdk/blob/e52a2aeeacaeb26c801b6e31f8e67e61b1ea2de3/src/java.base/windows/native/libjava/WinNTFileSystem_md.c#L473-L476
}

/**
* Returns true if the path refers to a directory junction, directory symlink, or regular symlink.
*
Expand Down

0 comments on commit 805c8f0

Please sign in to comment.