pub fn config_dirs() -> XdgDirsIter ⓘ🔬This is a nightly-only experimental API. (
xdg_basedir #157515)Available on Unix only.
Expand description
A set of preference ordered directories relative to which configuration files should be searched.
If an application defines a configuration file to be at $XDG_CONFIG_DIRS/appid/file.name, this means that:
- The initial configuration file should be installed to
{system_config_dir}/xdg/appid/file.name. - A user-specific version of the configuration file may be created at
{config_home_dir()}/appid/file.name. - Lookups for the configuration file should search for
./appid/file.namerelative toconfig_home_dirand each directory inconfig_dirs, giving preference to files found relative to an earlier directory in the search order.
An application may choose to handle a file being located under multiple base directories however it sees fit, so long as it respects the search order. For example, it could say that only the first file found is used, or that data within the files is merged in some way.