Module fs

Source
Expand description

Cuprate directories and filenames.

§Environment variables on Linux

Note that this module’s functions uses dirs, which adheres to the XDG standard on Linux.

This means that the values returned by these statics may change at runtime depending on environment variables, for example:

By default the config directory is ~/.config, however if $XDG_CONFIG_HOME is set to something, that will be used instead.

std::env::set_var("XDG_CONFIG_HOME", "/custom/path");
assert_eq!(
    CUPRATE_CONFIG_DIR.to_string_lossy(),
    "/custom/path/cuprate"
);

Reference:

Constants§

CUPRATE_DIR
Cuprate’s main directory.
DEFAULT_CONFIG_FILE_NAME
The default name of Cuprate’s config file.

Statics§

CUPRATE_CACHE_DIR
Cuprate’s cache directory.
CUPRATE_CONFIG_DIR
Cuprate’s config directory.
CUPRATE_DATA_DIR
Cuprate’s data directory.

Functions§

address_book_path
Cuprate’s address-book directory.
blockchain_path
Cuprate’s blockchain directory.
logs_path
Cuprate’s logs directory.
txpool_path
Cuprate’s txpool directory.