Chapter 38. Application-specific configuration directories

#include <x/config.H>

std::string configdir=x::configdir("");

x::configdir()'s parameter is an application identifier string. x::configdir() creates the directory $HOME/.libcxx/appid if it does not exist already, and returns an absolute pathname to this directory. x::configdir() installs a hidden symbolic links to the running process's executable in this directory; and ignores all of its other contents.

x::configdir() makes periodic checks of all subdirectories in $HOME/.libcxx, and removes subdirectories with broken symbolic links. This is meant to be used for a per-user application configuration directories; with a mechanism that automatically purges configuration directories linked to uninstalled applications, as long as at least one LibCXX application gets run regularly.