-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Document canonicalization in std::env::current_dir
#93598
Comments
For UNIX Rust just calls @rustbot label T-libs A-docs |
rustbot
added
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
labels
Feb 3, 2022
It was also missing for |
Thanks a lot |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 11, 2022
…c-info, r=Amanieu Add missing platform-specific information on current_dir and set_current_dir Fixes rust-lang#93598.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 11, 2022
…c-info, r=Amanieu Add missing platform-specific information on current_dir and set_current_dir Fixes rust-lang#93598.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of now, the stable and nightly documentation on
std::env::current_dir
only statesAnd 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
:I expected to see get the output:
"/example/symlink/here"
Instead, this was output:
"/symlink/target/here"
Currently using the nightly compiler.
For obvious reasons, there's no backtrace.
Update: Read a bit through the code and realized this behavior might be libc-dependent
ldd --version
on my system returnsldd (GNU libc) 2.33
The text was updated successfully, but these errors were encountered: