Skip to content

Commit 646ce75

Browse files
committed
Possible errors when reading file metadata are platform specific
In particular the `is_dir`, `is_file` and `exists` functions says that querying a file requires querying the directory. On Windows this is not normally true.
1 parent 772bb43 commit 646ce75

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
@@ -2462,10 +2462,10 @@ impl Path {
24622462
/// Returns `true` if the path points at an existing entity.
24632463
///
24642464
/// This function will traverse symbolic links to query information about the
2465-
/// destination file. In case of broken symbolic links this will return `false`.
2465+
/// destination file.
24662466
///
2467-
/// If you cannot access the directory containing the file, e.g., because of a
2468-
/// permission error, this will return `false`.
2467+
/// If you cannot access the metadata of the file, e.g. because of a
2468+
/// permission error or broken symbolic links, this will return `false`.
24692469
///
24702470
/// # Examples
24712471
///
@@ -2513,10 +2513,10 @@ impl Path {
25132513
/// Returns `true` if the path exists on disk and is pointing at a regular file.
25142514
///
25152515
/// This function will traverse symbolic links to query information about the
2516-
/// destination file. In case of broken symbolic links this will return `false`.
2516+
/// destination file.
25172517
///
2518-
/// If you cannot access the directory containing the file, e.g., because of a
2519-
/// permission error, this will return `false`.
2518+
/// If you cannot access the metadata of the file, e.g. because of a
2519+
/// permission error or broken symbolic links, this will return `false`.
25202520
///
25212521
/// # Examples
25222522
///
@@ -2545,10 +2545,10 @@ impl Path {
25452545
/// Returns `true` if the path exists on disk and is pointing at a directory.
25462546
///
25472547
/// This function will traverse symbolic links to query information about the
2548-
/// destination file. In case of broken symbolic links this will return `false`.
2548+
/// destination file.
25492549
///
2550-
/// If you cannot access the directory containing the file, e.g., because of a
2551-
/// permission error, this will return `false`.
2550+
/// If you cannot access the metadata of the file, e.g. because of a
2551+
/// permission error or broken symbolic links, this will return `false`.
25522552
///
25532553
/// # Examples
25542554
///

0 commit comments

Comments
 (0)