Uh oh!
There was an error while loading. Please reload this page.
Restore original meaning of std::fs::read_dir's example changed in #33958 - #34019
Conversation
…st-lang#33958. DirEntry.file_type().is_dir() will not follow symlinks, but the original example (fs::metadata(&path).is_dir()) does. Therefore the change in rust-lang#33958 introduced a subtle difference that now it won't enter linked folders. To preserve the same behavior, we use Path::is_dir() instead, which does follow symlink.
rust-highfive
commented
Jun 1, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
steveklabnik
commented
Jun 1, 2016
@bors: r+ rollup Thanks for sending the correction. |
bors
commented
Jun 1, 2016
📌 Commit 1d7f345 has been approved by |
Restore original meaning of std::fs::read_dir's example changed in rust-lang#33958 `DirEntry.file_type().is_dir()` will not follow symlinks, but the original example (`fs::metadata(&path).is_dir()`) does. Therefore the change in rust-lang#33958 introduced a subtle difference that now it won't enter linked folders. To preserve the same behavior, we use `Path::is_dir()` instead, which does follow symlink. (See discussion in the previous PR for detail.)
DirEntry.file_type().is_dir()will not follow symlinks, but the original example (fs::metadata(&path).is_dir()) does. Therefore the change in #33958 introduced a subtle difference that now it won't enter linked folders. To preserve the same behavior, we usePath::is_dir()instead, which does follow symlink.(See discussion in the previous PR for detail.)