The directories must be specified.

submited by
Style Pass
2021-05-17 11:43:30

The XDG base directory specification exists to address the problem of where programs should look for various kinds of files on a Unix system. Traditionally, in Unix, a per-program, per-user configuration file is stored as a “dot file”: program foo would expect to find a file such as $HOME/.foorc at startup, and if it doesn’t exist, read /etc/foorc. Or possibly both, and possibly more. This has led the home directories of Unix users to have tens, even hundreds of configuration files. Mine has currently 83 such files, but I pruned it brutally before the holidays. The specification specifies ways in which this mess can be reduced, as long as programs follow it.

Configuration files affect how a program does things. The specification assumes a model where a user can override per-system defaults, and those can override defaults shipped with the program, and those in turn can override built-in, hardcoded defaults. Thus, configuration files need to be looked up in a number of places.

Data files are files that the program needs or creates. Typically, these would be data such as icons, templates, and game levels, supplied with the program, but can also be things such as cookies saved by a web browser. Documents that the user creates using the program would typically be data files in this context.

Leave a Comment