-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Possible errors when accessing file metadata are platform specific #85760
Conversation
Are you saying that on windows you can always query the metadata of any file, regardless of the permissions you have to any of the directories it is in? That sounds wrong. |
Yes that's what I'm saying. On Windows permissions are based on the file only. There is a setting to do traverse-checking but doing so would likely break things. Both the OS and Windows software would not expect this behaviour. |
I'm trying to find a good explanatory article but in most of what I can find it's taken as a given. Perhaps this (scroll to "Traverse Folder/Execute File"): https://www.techrepublic.com/article/windows-101-know-the-basics-about-ntfs-permissions/ |
The "access the file" wording is also not accurate, since you can read the metadata of a file even without having any (read/write) access to it. Maybe instead of adding platform-specific notes here, it could just say:
|
I was slightly concerned about removing an explicitly documented situation in case it was documented for a good reason. But looking back at the commit that added it it seems the intent was only to document what happens on error without being too specific about implementation details. So I agree that the simpler wording is much clearer. I'll push the revised wording. |
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.
98f9adb
to
536d982
Compare
Thanks! @bors r+ rollup |
📌 Commit 536d982 has been approved by |
…laumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#83646 (Add a map method to Bound) - rust-lang#85501 (Fix `deny(invalid_doc_attributes)`) - rust-lang#85503 (rustdoc: add tooltips to some buttons) - rust-lang#85710 (Document `From` impls in path.rs) - rust-lang#85760 (Possible errors when accessing file metadata are platform specific) - rust-lang#85974 (td align attribute) - rust-lang#86014 (msp430 linker does not accept -znoexecstack. Set linker_is_gnu to fal…) Failed merges: - rust-lang#85972 (Rustdoc html fixes) r? `@ghost` `@rustbot` modify labels: rollup
In particular the
is_dir
,is_file
andexists
functions suggests that querying a file requires querying the directory. On Windows this is not normally true.r? @m-ou-se