about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-06-05 19:41:43 +0200
committerGitHub <noreply@github.com>2021-06-05 19:41:43 +0200
commit114aff58fdb0d15f2dbef22aa677a7fff01773d8 (patch)
tree39911084fe4dde6a3c4fd8fb662be1419b21a15d /library/std
parent6dfde9a8570bcb707c4089260aa6720a7a52bb6f (diff)
parent536d98238c8d1e63c316708d082bce063f1c3f84 (diff)
downloadrust-114aff58fdb0d15f2dbef22aa677a7fff01773d8.tar.gz
rust-114aff58fdb0d15f2dbef22aa677a7fff01773d8.zip
Rollup merge of #85760 - ChrisDenton:path-doc-platform-specific, r=m-ou-se
Possible errors when accessing file metadata are platform specific

In particular the `is_dir`, `is_file` and `exists` functions suggests that querying a file requires querying the directory. On Windows this is not normally true.

r? `@m-ou-se`
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/path.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index 64ff7a23d47..ede147aca12 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -2486,10 +2486,10 @@ impl Path {
     /// Returns `true` if the path points at an existing entity.
     ///
     /// This function will traverse symbolic links to query information about the
-    /// destination file. In case of broken symbolic links this will return `false`.
+    /// destination file.
     ///
-    /// If you cannot access the directory containing the file, e.g., because of a
-    /// permission error, this will return `false`.
+    /// If you cannot access the metadata of the file, e.g. because of a
+    /// permission error or broken symbolic links, this will return `false`.
     ///
     /// # Examples
     ///
@@ -2537,10 +2537,10 @@ impl Path {
     /// Returns `true` if the path exists on disk and is pointing at a regular file.
     ///
     /// This function will traverse symbolic links to query information about the
-    /// destination file. In case of broken symbolic links this will return `false`.
+    /// destination file.
     ///
-    /// If you cannot access the directory containing the file, e.g., because of a
-    /// permission error, this will return `false`.
+    /// If you cannot access the metadata of the file, e.g. because of a
+    /// permission error or broken symbolic links, this will return `false`.
     ///
     /// # Examples
     ///
@@ -2569,10 +2569,10 @@ impl Path {
     /// Returns `true` if the path exists on disk and is pointing at a directory.
     ///
     /// This function will traverse symbolic links to query information about the
-    /// destination file. In case of broken symbolic links this will return `false`.
+    /// destination file.
     ///
-    /// If you cannot access the directory containing the file, e.g., because of a
-    /// permission error, this will return `false`.
+    /// If you cannot access the metadata of the file, e.g. because of a
+    /// permission error or broken symbolic links, this will return `false`.
     ///
     /// # Examples
     ///