Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently chmod is a noop on Windows, while analogous functions like
chown and umask throw (see #4306). Symlink also currently throws, but
that can be implemented on Windows, it just hasn't been done yet
(see #815, an implementation was crafted but there were issues that
haven't been resolved yet).
It's possible to implement chmod in Windows to a limited degree: Rust
lets one make Windows files read-only. But the API for how this should
work hasn't been settled (see #4357). Until we do implement chmod on
Windows, perhaps we should make it throw like the other
Windows-unimplemented functions in /cli/ops/fs.rs do?
If so, this PR provides an implementation, and fixes tests accordingly.
Note that the current implementation of writeFile applies its
mode
option to the file regardless of whether the file was created (and does
so using chmod, so it has to be touched by this PR). A forthcoming PR in
the #4017 series will make writeFile instead use the new
mode
optionin open for new files, and so no longer rely on chmod.