Library
Module
Module type
Parameter
Class
Class type
XDG basedir implementation
The XDG basedir specification makes clear where to store configuration, cache and data files. This a way to maintain a clean $HOME. Locations can be customized through environment variables (XDG_DATA_HOME, XDG_CONFIG_HOME). It also allows to store files in several places (i.e. system directories).
type dirnames = dirname list
type t = {
data_home : dirname;
$HOME/.local/share
*)data_dirs : dirnames;
/usr/share
*)config_home : dirname;
$HOME/.config
*)config_dirs : dirnames;
/etc/xdg
*)cache_home : dirname;
$HOME/.cache
*)}
XDG environment
val default : t
Default XDG environment
mkdir_openfile f fn
Create parent directory of fn
and apply f fn
module Data : sig ... end
In this module, ~xdg_env
allows to override the default XDG environment. If you use ~exists:true
, the files/dirs are tested for existence.