xdg-home

Crates.ioxdg-home
lib.rsxdg-home
version1.3.0
sourcesrc
created_at2023-03-28 22:24:11.505242
updated_at2024-08-09 16:07:03.131017
descriptionThe user's home directory as per XDG Specification
homepage
repositoryhttps://github.com/zeenix/xdg-home
max_upload_size
id823500
size8,994
Zeeshan Ali Khan (zeenix)

documentation

README

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());
Commit count: 20

cargo fmt