Crate cross_xdg

Crate cross_xdg 

Source
Expand description

Cross plattform XDG base directory specification.

This library provides a way to access the XDG base directory specification on all platforms. The XDG base directory specification is a standard for storing user-specific configuration, data, cache, and runtime files. It is used by many Linux desktop environments and applications. The specification is defined in the XDG Base Directory Specification.

In contrast to other XDG base directory crates or standard directory crates, cross-xdg provides XDG directories on Windows and macOS just like on Linux.

Example for Linux:

use cross_xdg::BaseDirs;
let base_dirs = BaseDirs::new().unwrap();

// On Linux: resolves to /home/<user>/.config
// On Windows: resolves to C:\Users\<user>\.config
// On macOS: resolves to /Users/<user>/.config
let config_home = base_dirs.config_home();

Structs§

BaseDirs
The BaseDirs struct provides access to the XDG base directories.

Traits§

BaseDirsEx
Extension trait for PathBuf to help with common task on directories.