Skip to main content

Module xdg

Module xdg 

Source
🔬This is a nightly-only experimental API. (xdg_basedir #157515)
Available on Unix only.
Expand description

XDG (X Desktop Group) related functionality for Unix platforms.

The XDG Base Directory Specification defines a set of base directories, relative to which user-specific files should be looked for. The functions in this module provide those directory paths as configured by the environment.

Note that the use of these functions is not enforced by the system, and as such, not all programs will necessarily respect all details of the XDG path environment. This is a set of guidelines, and each program is ultimately responsible for defining where and how it both reads and writes files.

Use of XDG paths can be generally considered the conventional expectation on Linux-based systems. Other Unix-based systems may or may not play well with the XDG conventions.

Directories returned by this module are not guaranteed to exist yet. If the directory does not exist, an application should attempt to create it with permissions mode 0o700.

Structs§

XdgDirsIterExperimental
An iterator that produces directory paths from XDG environment configuration.

Functions§

cache_home_dirExperimental
A base directory relative to which user-specific non-essential (cached) data should be written.
config_dirsExperimental
A set of preference ordered directories relative to which configuration files should be searched.
config_home_dirExperimental
A base directory relative to which user-specific configuration files should be written.
data_dirsExperimental
A set of preference ordered directories relative to which data files should be searched.
data_home_dirExperimental
A base directory relative to which user-specific data files should be written.
state_home_dirExperimental
A base directory relative to which user-specific state data should be written.