2 stable releases

1.1.0 Feb 4, 2024
1.0.0 Mar 28, 2023

#180 in Filesystem

Download history 38496/week @ 2023-12-24 51100/week @ 2023-12-31 55630/week @ 2024-01-07 67296/week @ 2024-01-14 100367/week @ 2024-01-21 113307/week @ 2024-01-28 67907/week @ 2024-02-04 64896/week @ 2024-02-11 67357/week @ 2024-02-18 73472/week @ 2024-02-25 77877/week @ 2024-03-03 75844/week @ 2024-03-10 84961/week @ 2024-03-17 85104/week @ 2024-03-24 84887/week @ 2024-03-31 66508/week @ 2024-04-07

328,232 downloads per month
Used in 292 crates (5 directly)

MIT license

6KB
75 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

~215KB