Skip to content

Commit

Permalink
Rollup merge of rust-lang#109263 - squell:master, r=cuviper
Browse files Browse the repository at this point in the history
fix typo in documentation for std::fs::Permissions

Please check and re-check this PR carefully to see if I got this right.

But by my logic, if the `read_only` function returns `true`, I would not expect be able to write to the file (it being read only); so this text is meant to clarify that `read_only` being `false` doesn't mean *you* can actually write to the file, just that "in general" someone is able to.
  • Loading branch information
matthiaskrgr authored Mar 2, 2024
2 parents 2e3581b + b353765 commit 56ba5af
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1476,11 +1476,10 @@ impl Permissions {
/// On Unix-based platforms this checks if *any* of the owner, group or others
/// write permission bits are set. It does not check if the current
/// user is in the file's assigned group. It also does not check ACLs.
/// Therefore even if this returns true you may not be able to write to the
/// file, and vice versa. The [`PermissionsExt`] trait gives direct access
/// to the permission bits but also does not read ACLs. If you need to
/// accurately know whether or not a file is writable use the `access()`
/// function from libc.
/// Therefore the return value of this function cannot be relied upon
/// to predict whether attempts to read or write the file will actually succeed.
/// The [`PermissionsExt`] trait gives direct access to the permission bits but
/// also does not read ACLs.
///
/// [`PermissionsExt`]: crate::os::unix::fs::PermissionsExt
///
Expand Down

0 comments on commit 56ba5af

Please sign in to comment.