-
Notifications
You must be signed in to change notification settings - Fork 13
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
home_dir
is lying about its functionality on Unix systems
#22
Comments
home_dir
is lying about its function on Unixeshome_dir
is lying about its function on Unix systems
home_dir
is lying about its function on Unix systemshome_dir
is lying about its functionality on Unix systems
It's tricky. It's not obvious that using an empty So it seems reasonable (technically) to use an empty The std considers an empty result from I can imagine use cases for setting All that said, empty home directories seems like a potential source of errors, so I'm inclined to agree with the approach of The
and in dirs-sys:
Though note that a) dirs-sys has a special treatment for redox Also note that this crate and dirs-sys have different code for the windows SHGet(Known)FolderPath call that I have not looked closely at:
It would probably be worth reviewing. With the awkward maintainership situation in dirs-sys I am inclined to take on the correct code for unix cc @tarcieri I've seen you have opinions about this crate |
Thanks for continuing to maintain this crate @lzutao |
If this crate made its own unix |
I'd be fine with this crate using I will say one of the things that drew me to it in the first place was the small number of dependencies. Adding My main use case was finding |
Thanks for thorough advice Brian. I may spend some time later to decide. |
home
usesstd::env::home_dir
for non Windows systems and states thathome/src/lib.rs
Lines 42 to 43 in 3a6eccd
but after https://github.com/rust-lang/rust/pull/51656/files#diff-b596503c7c33ce457b6d047e351ac12bR516, Rust changes
home_dir
doc on Unixes.There are two way to move forward now:
Correct documentation by copying
std::env::home_dir
doc.After all, POSIX requires systems to init "HOME" env after user loging: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html
Re-implement for all UNIX targets, this is harmful for maintenance. Because unlike Windows,
there are many Unix systems worth considering to support.
cc @brson for advice
The text was updated successfully, but these errors were encountered: