So where do I put my configuration files then?

So where do I put my configuration files then?


The correct directory for this usually depends on the particular flavour
of Unix you're using; `/var/opt/PACKAGE', `/usr/local/lib',
`/usr/local/etc', or any of several other possibilities.
User-specific configuration files are usually hidden `dotfiles' under
$HOME (e.g. `$HOME/.exrc').



From the point of view of a package that is expected to be usable across
a range of systems, this usually implies that the location of any
sitewide configuration files will be a compiled-in default, possibly
using a `--prefix' option on a configure script (Autoconf scripts
do this). You might wish to allow this to be overridden at runtime by
an environment variable. (If you're not using a configure script, then
put the default in the Makefile as a `-D' option on compiles, or
put it in a `config.h' header file, or something similar.)



User-specific configuration should be either a single dotfile under
$HOME, or, if you need multiple files, a dot-subdirectory.
(Files or directories whose names start with a dot are omitted from
directory listings by default.) Avoid creating multiple entries under
$HOME, because this can get very cluttered. Again, you can allow
the user to override this location with an environment
variable. Programs should always behave sensibly if they fail to find
any per-user configuration.






Home FAQ