-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fs::metadata(entry_path).file_type().is_symlink() not work #39088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm on Linux Mint, the kernel version is |
The file system is ext4 |
Duplicate of #29302; not a bug. EDIT: Or rather, is a documentation bug. |
Update the docs for |
Hi. I'm new to rust, and have been looking through the E-easy tagged bugs for one it would be easy to start with. (Thank you very much for making easy bugs available as on-ramps, it is very very much appreciated.) I think the appropriate change is in src/libstd/fs.rs in the documentation for is_symlink(). Adding a second line to the description warning that you should use symlink_metadata by default, and changing the example to use fs::symlink_metadata() not fs::metadata(). I have made and tested that change locally. Does that sound right? |
Yes. I would suggest just submitting a PR. Reviewing (commenting on) code directly both spares you the effort describing the changes and us from parsing the description. |
fs::metadata() follows symlinks so is_symlink() will always return false. Use symlink_metadata instead in the example in the documentation. See issue rust-lang#39088.
Use fs::symlink_metadata in doc for is_symlink fs::metadata() follows symlinks so is_symlink() will always return false. Use symlink_metadata instead in the example in the documentation. See issue #39088.
I believe this one is done? |
Assuming I'm right, yes, I think my commit fixed this particular issue, did everything suggested, and is now merged safely to master. |
Addressed by @CartesianDaemon in #39176. Thanks again! |
It's always false.
The text was updated successfully, but these errors were encountered: