From 53469cfc3f0cc25530c1b5407f5dad97f103f8c6 Mon Sep 17 00:00:00 2001 From: "Marc R. Schoolderman" <4155359+squell@users.noreply.github.com> Date: Fri, 17 Mar 2023 14:33:50 +0100 Subject: [PATCH 1/3] fix typo in documentation for std::fs::Permissions --- library/std/src/fs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index c550378e7d6..342ea156231 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -1406,7 +1406,7 @@ 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 + /// Therefore even if this returns false 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()` From 0df002a2e2001bf87f56d27ebf300daa4b574b6b Mon Sep 17 00:00:00 2001 From: Marc Schoolderman Date: Tue, 29 Aug 2023 11:20:56 +0200 Subject: [PATCH 2/3] rewording after comments by @thomcc --- library/std/src/fs.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 342ea156231..e506b321c25 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -1406,11 +1406,11 @@ 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 false 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. If you need to accurately know whether or not a file + /// is writable use the `access()` function from libc. /// /// [`PermissionsExt`]: crate::os::unix::fs::PermissionsExt /// From b35376512031a24e236f66cbca8712ecea5e721c Mon Sep 17 00:00:00 2001 From: Marc Schoolderman Date: Thu, 22 Feb 2024 11:42:39 +0100 Subject: [PATCH 3/3] remove potentially misleading sentence about libc::access --- library/std/src/fs.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index e506b321c25..d5387e2e2b4 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -1409,8 +1409,7 @@ impl Permissions { /// 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. If you need to accurately know whether or not a file - /// is writable use the `access()` function from libc. + /// also does not read ACLs. /// /// [`PermissionsExt`]: crate::os::unix::fs::PermissionsExt ///