Struct dirs::Directories [] [src]

pub struct Directories {
    // some fields omitted
}

The main type of this library. Create one via Directories::with_prefix and use it to query operation system specific paths, such as configuration directories.

Methods

impl Directories
[src]

fn with_prefix<P, Q>(prefix_lowercased: P, prefix_capitalized: Q) -> Result<Directories> where P: AsRef<Path>, Q: AsRef<Path>

Creates a Directories object that can be queried for application specific paths for things like configuration files and cache locations.

fn config_home(&self) -> PathBuf

Returns the user-specific directory for configuration files.

On Windows, this is the AppData\Roaming\Prefix directory of the current user, corresponding to FOLDERID_RoamingAppData.

On UNIX systems, this is determined by the XDG Base Directory specification, and can be set by the environment variable XDG_CONFIG_HOME. It defaults to ~/.config/prefix.

On OS X, this is ~/Library/Prefix.

fn cache_home(&self) -> PathBuf

Returns the user-specific directory for cache files.

On Windows, this is the AppData\Local\Temp\Prefix directory of the current user, obtained through GetTempPath.

On UNIX systems, this is determined by the XDG Base Directory specification, and can be set by the environment variable XDG_CACHE_DIR. It defaults to ~/.cache/prefix.

On OS X, this is ~/Library/Caches/Prefix.

fn bin_home(&self) -> PathBuf

Returns the user-specific directory for executables.

On Windows, this is the AppData\Local\Programs\Prefix directory of the current user, corresponding to FOLDERID_UserProgramFiles.

On UNIX systems, this is determined by the XDG Base Directory specification, and can be set by the environment variable XDG_CACHE_DIR.

On OSX, this is ~/Library/Prefix/bin.