dirs

argparse.dirs
See thedirs companion object
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

Attributes

name

the name of the application

system

use system-wide paths instead of user-specific ones

Companion:
object
Deprecated
true
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

def state: Path

A directory for persisting application state.

A directory for persisting application state.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product