4 stable releases
| 1.3.0 | Aug 9, 2024 |
|---|---|
| 1.2.0 | Jun 8, 2024 |
| 1.1.0 | Feb 4, 2024 |
| 1.0.0 | Mar 28, 2023 |
#119 in Filesystem
527,237 downloads per month
Used in 317 crates
(6 directly)
7KB
89 lines
xdg-home
Gets the user's home directory as per XDG Base Directory Specification.
This is almost the same as home (and dirs) crate, except it honors HOME environment
variable on the Windows platform as well, which is conformant to the XDG Base Directory
Specification.
Use it where the XDG Base Directory Specification is applicable, such as in D-Bus code.
Example
use xdg_home::home_dir;
let home = home_dir().unwrap();
assert!(home.is_absolute());
assert!(home.exists());
println!("Home directory: {}", home.display());
Dependencies
~0–12MB
~81K SLoC