dirs

@deprecated("use userdirs for user-specific directories, and the FHS standard for system dirs", "0.10.3") case class dirs(name: String, system: Boolean)

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
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def cache: Path

A directory in which to read and write non-essential (cached) data.

A directory in which to read and write non-essential (cached) data.

def config: List[Path]

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.

def data: List[Path]

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.

def log: Path

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.

def runtime: Path

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.

def state: Path

A directory for persisting application state.

A directory for persisting application state.

Inherited methods

def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product