-
Notifications
You must be signed in to change notification settings - Fork 13.3k
std::fs::symlink_metadata + set_permissions makes unintuitive behavior #124201
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
Comments
symlink permissions have no effect or can't be set on most unixes, therefore setting them does not make sense as a portable API. |
I agree that point. macOS and a few more BSDs are affect by this. Adding a short warning will make sense. |
both versions of |
perhaps it would even be worth making a |
…5942, r=thomcc std(docs): clarify how std::fs::set_permisions works with symlinks fixes rust-lang#75942 fixes rust-lang#124201
…5942, r=thomcc std(docs): clarify how std::fs::set_permisions works with symlinks fixes rust-lang#75942 fixes rust-lang#124201
…5942, r=thomcc std(docs): clarify how std::fs::set_permisions works with symlinks fixes rust-lang#75942 fixes rust-lang#124201
Rollup merge of rust-lang#139546 - lolbinarycat:std-set_permissions-75942, r=thomcc std(docs): clarify how std::fs::set_permisions works with symlinks fixes rust-lang#75942 fixes rust-lang#124201
Location
std::fs::symlink_metadata
orstd::fs::set_permissions
Summary
Since I could obtain metadata for either original file or symlink, I expected there must be a way to apply permissions to symlink. But
symlink_metadata
revealed not to have a pair ofset_permissions
.By the design if it is intended or lack of API, it could be documented somewhere like
symlink_metadata
orset_permissions
.On the other hand, metadata is obtainable from either file or symlink. Then I expected
set_permission
to be placed on metadata object if metadata includes symlink information.e.g.
metadata.set_permissions(path, permissions)
The text was updated successfully, but these errors were encountered: