-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
std::fs::symlink_metadata + set_permissions makes unintuitive behavior #124201
Copy link
Copy link
Closed
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 toolsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library 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 toolsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Location
std::fs::symlink_metadataorstd::fs::set_permissionsSummary
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_metadatarevealed 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_metadataorset_permissions.On the other hand, metadata is obtainable from either file or symlink. Then I expected
set_permissionto be placed on metadata object if metadata includes symlink information.e.g.
metadata.set_permissions(path, permissions)