Skip to main content

runtime_dir

Function runtime_dir 

Source
pub fn runtime_dir() -> PathBuf
Expand description

The runtime directory for this process (§24.2).

ASTRS_RUNTIME_DIR wins; otherwise $XDG_RUNTIME_DIR/astrs; otherwise the system temporary directory with the same leaf, which is what makes a node runnable on a desktop macOS session where XDG_RUNTIME_DIR is unset.

§Examples

let dir = astrs_node_api::env::runtime_dir();
assert!(dir.is_absolute() || dir.components().count() > 0);