dirs +linux +x86_64

The dirs module provides access to common paths and directories used for storing application data. This module is compatible with the XDG base directories specification:

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Index

Functions

fn cache(str) str;
fn cachefs(str) *fs::fs;
fn config(str) str;
fn configfs(str) *fs::fs;
fn data(str) str;
fn datafs(str) *fs::fs;
fn state(str) str;
fn statefs(str) *fs::fs;

Functions

fn cache[link]

fn cache(prog: str) str;

Returns a directory suitable for cache files. The "prog" parameter should be a descriptive name unique to this program. The return value is statically allocated and will be overwritten on subsequent calls to any function in the dirs module.

fn cachefs[link]

fn cachefs(prog: str) *fs::fs;

Returns an fs::fs for cache files.

fn config[link]

fn config(prog: str) str;

Returns a directory suitable for storing config files. The "prog" parameter should be a descriptive name unique to this program. The return value is statically allocated and will be overwritten on subsequent calls to any function in the dirs module.

fn configfs[link]

fn configfs(prog: str) *fs::fs;

Returns an fs::fs for storing config files. The "prog" parameter should be a descriptive name unique to this program.

fn data[link]

fn data(prog: str) str;

Returns a directory suitable for persistent data files. The "prog" parameter should be a descriptive name unique to this program. The return value is statically allocated and will be overwritten on subsequent calls to any function in the dirs module.

fn datafs[link]

fn datafs(prog: str) *fs::fs;

Returns an fs::fs for persistent data files. If "prog" is given, a unique path for this program to store data will be returned.

fn state[link]

fn state(prog: str) str;

Returns a directory suitable for storing program state data. The "prog" parameter should be a descriptive name unique to this program. The return value is statically allocated and will be overwritten on subsequent calls to any function in the dirs module.

fn statefs[link]

fn statefs(prog: str) *fs::fs;

Returns an fs::fs for storing program state data.