fs::Permissions set_readonly is odd on Unix. #41984
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Uh oh!
There was an error while loading. Please reload this page.
set_readonly(true)
wipes out write permissions, leaving existing executable permissions in place. This seems contrary to what I would expect this function to do: make something only readable. I would expectset_readonly(true)
to set the permissions to0o444
.set_readonly(false)
adds write permissions to make permissions not readonly, as opposed to wiping out read permissions. Setting permissions to not readonly itself is a bit odd to begin with. Any combination of permissions that are not just read is technically not read only. I don't have a good solution to this, but I think more clarifying documentation would suffice.The text was updated successfully, but these errors were encountered: