File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -2515,9 +2515,10 @@ impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
25152515/// This function will traverse symbolic links to query information about the
25162516/// destination file. In case of broken symbolic links this will return `Ok(false)`.
25172517///
2518- /// As opposed to the [`Path::exists`] method, this one doesn't silently ignore errors
2519- /// unrelated to the path not existing. (E.g. it will return `Err(_)` in case of permission
2520- /// denied on some of the parent directories.)
2518+ /// As opposed to the [`Path::exists`] method, this will only return `Ok(true)` or `Ok(false)`
2519+ /// if the path was _verified_ to exist or not exist. If its existence can neither be confirmed
2520+ /// nor denied, an `Err(_)` will be propagated instead. This can be the case if e.g. listing
2521+ /// permission is denied on one of the parent directories.
25212522///
25222523/// Note that while this avoids some pitfalls of the `exists()` method, it still can not
25232524/// prevent time-of-check to time-of-use (TOCTOU) bugs. You should only use it in scenarios
Original file line number Diff line number Diff line change @@ -2844,9 +2844,11 @@ impl Path {
28442844 /// This function will traverse symbolic links to query information about the
28452845 /// destination file. In case of broken symbolic links this will return `Ok(false)`.
28462846 ///
2847- /// As opposed to the [`exists()`] method, this one doesn't silently ignore errors
2848- /// unrelated to the path not existing. (E.g. it will return `Err(_)` in case of permission
2849- /// denied on some of the parent directories.)
2847+ /// [`Path::exists()`] only checks whether or not a path was both found and readable. By
2848+ /// contrast, `try_exists` will return `Ok(true)` or `Ok(false)`, respectively, if the path
2849+ /// was _verified_ to exist or not exist. If its existence can neither be confirmed nor
2850+ /// denied, it will propagate an `Err(_)` instead. This can be the case if e.g. listing
2851+ /// permission is denied on one of the parent directories.
28502852 ///
28512853 /// Note that while this avoids some pitfalls of the `exists()` method, it still can not
28522854 /// prevent time-of-check to time-of-use (TOCTOU) bugs. You should only use it in scenarios
You can’t perform that action at this time.
0 commit comments