Common directories for an application of a given name.
The directories here are implemented as a mix of the XDG Base Directory Specification, macOS adaptations and a fallback to classic unix directories for system applications.
Applications are encouraged to use these directories instead of creating their own hierarchies. They are particularly well-suited for use as parameter defaults, for example:
val parser = argparse.ArgumentParser()
val cache = parser.param[os.Path](
"--cache-dir",
default = argparse.dirs("myapp").cache
- Value Params
- name
the name of the application
- system
use system-wide paths instead of user-specific ones
- Companion
- object
- Deprecated
Value members
Concrete methods
A directory in which to read and write non-essential (cached) data.
A directory in which to read and write non-essential (cached) data.
A list of preference ordered directories relative to which configuration files should be searched.
A list of preference ordered directories relative to which configuration files should be searched.
This list is guaranteed to have at least one element. The head directory may be used for writing.
A list of preference ordered directories relative to which data files should be searched.
A list of preference ordered directories relative to which data files should be searched.
This list is guaranteed to have at least one element. The head directory may be used for writing.
A directory for storing log files.
A directory for storing log files.
Note: in general, the logging system should not be a concern of the application itself, and hence this directory should not be used. The way logs are collected will vary depending on the deployment, hence the most portable way to log diagnostic messages is to simply write them to stderr.
A directory in which to read and write runtime files, such as sockets and small temporary files.
A directory in which to read and write runtime files, such as sockets and small temporary files.