Skip to content

Commit aeee1f5

Browse files
authored
Rollup merge of rust-lang#109263 - squell:master, r=cuviper
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.
2 parents 4cdd205 + b353765 commit aeee1f5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

library/std/src/fs.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1476,11 +1476,10 @@ impl Permissions {
14761476
/// On Unix-based platforms this checks if *any* of the owner, group or others
14771477
/// write permission bits are set. It does not check if the current
14781478
/// user is in the file's assigned group. It also does not check ACLs.
1479-
/// Therefore even if this returns true you may not be able to write to the
1480-
/// file, and vice versa. The [`PermissionsExt`] trait gives direct access
1481-
/// to the permission bits but also does not read ACLs. If you need to
1482-
/// accurately know whether or not a file is writable use the `access()`
1483-
/// function from libc.
1479+
/// Therefore the return value of this function cannot be relied upon
1480+
/// to predict whether attempts to read or write the file will actually succeed.
1481+
/// The [`PermissionsExt`] trait gives direct access to the permission bits but
1482+
/// also does not read ACLs.
14841483
///
14851484
/// [`PermissionsExt`]: crate::os::unix::fs::PermissionsExt
14861485
///

0 commit comments

Comments
 (0)