Skip to content

Commit 17a8766

Browse files
Rollup merge of rust-lang#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`
2 parents 5dc7c9d + 646ce75 commit 17a8766

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

std/src/path.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -2486,10 +2486,10 @@ impl Path {
24862486
/// Returns `true` if the path points at an existing entity.
24872487
///
24882488
/// This function will traverse symbolic links to query information about the
2489-
/// destination file. In case of broken symbolic links this will return `false`.
2489+
/// destination file.
24902490
///
2491-
/// If you cannot access the directory containing the file, e.g., because of a
2492-
/// permission error, this will return `false`.
2491+
/// If you cannot access the metadata of the file, e.g. because of a
2492+
/// permission error or broken symbolic links, this will return `false`.
24932493
///
24942494
/// # Examples
24952495
///
@@ -2537,10 +2537,10 @@ impl Path {
25372537
/// Returns `true` if the path exists on disk and is pointing at a regular file.
25382538
///
25392539
/// This function will traverse symbolic links to query information about the
2540-
/// destination file. In case of broken symbolic links this will return `false`.
2540+
/// destination file.
25412541
///
2542-
/// If you cannot access the directory containing the file, e.g., because of a
2543-
/// permission error, this will return `false`.
2542+
/// If you cannot access the metadata of the file, e.g. because of a
2543+
/// permission error or broken symbolic links, this will return `false`.
25442544
///
25452545
/// # Examples
25462546
///
@@ -2569,10 +2569,10 @@ impl Path {
25692569
/// Returns `true` if the path exists on disk and is pointing at a directory.
25702570
///
25712571
/// This function will traverse symbolic links to query information about the
2572-
/// destination file. In case of broken symbolic links this will return `false`.
2572+
/// destination file.
25732573
///
2574-
/// If you cannot access the directory containing the file, e.g., because of a
2575-
/// permission error, this will return `false`.
2574+
/// If you cannot access the metadata of the file, e.g. because of a
2575+
/// permission error or broken symbolic links, this will return `false`.
25762576
///
25772577
/// # Examples
25782578
///

0 commit comments

Comments
 (0)