1
Fork 0

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`
This commit is contained in:
Guillaume Gomez 2021-06-05 19:41:43 +02:00 committed by GitHub
commit 114aff58fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2486,10 +2486,10 @@ impl Path {
/// Returns `true` if the path points at an existing entity. /// Returns `true` if the path points at an existing entity.
/// ///
/// This function will traverse symbolic links to query information about the /// 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 /// If you cannot access the metadata of the file, e.g. because of a
/// permission error, this will return `false`. /// permission error or broken symbolic links, this will return `false`.
/// ///
/// # Examples /// # Examples
/// ///
@ -2537,10 +2537,10 @@ impl Path {
/// Returns `true` if the path exists on disk and is pointing at a regular file. /// 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 /// 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 /// If you cannot access the metadata of the file, e.g. because of a
/// permission error, this will return `false`. /// permission error or broken symbolic links, this will return `false`.
/// ///
/// # Examples /// # Examples
/// ///
@ -2569,10 +2569,10 @@ impl Path {
/// Returns `true` if the path exists on disk and is pointing at a directory. /// 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 /// 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 /// If you cannot access the metadata of the file, e.g. because of a
/// permission error, this will return `false`. /// permission error or broken symbolic links, this will return `false`.
/// ///
/// # Examples /// # Examples
/// ///