You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document canonicalization in std::env::current_dir #93598
As of now, the stable and nightly documentation on std::env::current_dir only states
Returns the current working directory as a PathBuf.
And proceeds to note a couple of errors the function may fail with.
This does not mention the fact that (as far as I am aware, testing on Linux) the path is also canonicalized, having resolved all symlinks in any segment of the path. I'd imagine not documenting this behavior could lead to confusion and/or bugs, if it already hasn't.
I tried this code within a symlink folder /example/symlink/here pointing to /symlink/target/here:
For UNIX Rust just calls getcwd() and that behavior is documented in the POSIX spec, so it will be the same on all conforming implementations. We should document which platform-specific function we call here just like we do with other filesystem functions (e.g. here).
Activity
hkratz commentedon Feb 3, 2022
For UNIX Rust just calls
getcwd()and that behavior is documented in the POSIX spec, so it will be the same on all conforming implementations. We should document which platform-specific function we call here just like we do with other filesystem functions (e.g. here).@rustbot label T-libs A-docs
GuillaumeGomez commentedon Feb 3, 2022
It was also missing for
set_current_dirso I opened #93635 for both.AZMCode commentedon Feb 4, 2022
Thanks a lot
Rollup merge of rust-lang#93635 - GuillaumeGomez:missing-platform-spe…
Rollup merge of rust-lang#93635 - GuillaumeGomez:missing-platform-spe…
Rollup merge of rust-lang#93635 - GuillaumeGomez:missing-platform-spe…