2 stable releases

1.1.0 Feb 4, 2024
1.0.0 Mar 28, 2023

#182 in Filesystem

Download history 55284/week @ 2024-01-03 54744/week @ 2024-01-10 88734/week @ 2024-01-17 105774/week @ 2024-01-24 91740/week @ 2024-01-31 65682/week @ 2024-02-07 65877/week @ 2024-02-14 69030/week @ 2024-02-21 78315/week @ 2024-02-28 77739/week @ 2024-03-06 76263/week @ 2024-03-13 86230/week @ 2024-03-20 84411/week @ 2024-03-27 84183/week @ 2024-04-03 84659/week @ 2024-04-10 73318/week @ 2024-04-17

340,492 downloads per month
Used in 293 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