-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add chmod/chmodSync on *nix (and fix Cargo.toml) #1088
Conversation
83d758a
to
9d624a6
Compare
js/chmod_test.ts
Outdated
testPerm({ write: false }, function chmodSyncPerm() { | ||
let err; | ||
try { | ||
const filename = deno.makeTempDirSync() + "/test.txt"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think deno.makeTempDirSync()
raise a PermissionDenied error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops. Thanks for pointing out
On windows there are a bunch of errors like this
Otherwise looks good! |
9625f41
to
4c0c611
Compare
4c0c611
to
4e12a47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks!
@ry @kevinkassimo can you suggest me what to do next. |
- Add URLSearchParams (denoland#1049) - Implement clone for FetchResponse (denoland#1054) - Use content-type headers when importing from URLs. (denoland#1020) - Use checkJs option, JavaScript will be type checked and users can supply JSDoc type annotations that will be enforced by Deno (denoland#1068) - Add separate http/https cache dirs to DENO_DIR (denoland#971) - Support https in fetch. (denoland#1100) - Add chmod/chmodSync on unix (denoland#1088) - Remove broken features: --deps and trace() (denoland#1103) - Ergonomics: Prompt TTY for permission escalation (denoland#1081)
- Add URLSearchParams (#1049) - Implement clone for FetchResponse (#1054) - Use content-type headers when importing from URLs. (#1020) - Use checkJs option, JavaScript will be type checked and users can supply JSDoc type annotations that will be enforced by Deno (#1068) - Add separate http/https cache dirs to DENO_DIR (#971) - Support https in fetch. (#1100) - Add chmod/chmodSync on unix (#1088) - Remove broken features: --deps and trace() (#1103) - Ergonomics: Prompt TTY for permission escalation (#1081)
Continuation from #673 (since no updates for quite a while and this is an important fs call)
Implements
chmod
andchmodSync
on *nix. (On windows this is noop)Prior art:
os.Chmod(name string, mode FileMode) error
fs.chmod(file, mode, callback);
os.chmod(path, mode);
std::fs::set_permissions<P: AsRef>(path: P, perm: Permissions) -> Result<()>
lchmod
is not implemented yet. It seems that Ruststd::fs
only support inspecting symlink metadata, but anyset_permissions/set_mode
calls would eventually set the permission of linked file/dir.Also, add
getopts
entry inCargo.toml
(forgot to include this in the PR yesterday)