[][src]Function fungus::sys::user::runtime_dir

pub fn runtime_dir() -> PathBuf

Returns the full path to the current user's runtime directory. Used for non-essential, user-specific data files such as sockets, named pipes, etc. Must be owned by the user with an access mode of 0700. Filesystem fully featured by standards of OS. Must be on the local filesystem. May be subject to periodic cleanup. Modified every 6 hours or set sticky bit if persistence is desired. Can only exist for the duration of the user's login. Should not store large files as it may be mounted as a tmpfs.

Defaults to /tmp if $XDG_RUNTIME_DIR is not set

Examples

use fungus::prelude::*;

println!("runtime directory of the current user: {:?}", user::runtime_dir());