-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Documentation for PermissionsExt::set_mode should link to set_permissions #91707
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I'm opening this issue because it took me far too much time to realize that set_mode isn't actually doing anything to the underlying file.
Based on the rust std docs I've first tried to set an executable bit with this code:
I expected to see this happen: The code sets the permissions bit.
Instead, this happened: Obviously nothing, because you have to call
std::fs::set_permissionsThe docs for
PermissionsExt::set_modeshould link tostd::fs::set_permissionsso users know that set_mode doesn't actually perform anything on the file and instead something like this should be done:This may be relevant for more than only
std::os::unix::fs::PermissionsExt.Meta
rustc --version --verbose: