Skip to main content

Module fs_util

Module fs_util 

Source
Expand description

Small filesystem helpers for atomic, permission-restricted writes.

The main entry point is write_atomic_restricted. It is used by crate::creds_store (file-backed credential store) and by Config::save, both of which write into ~/.harmont/ (see config::user_config_dir).

Functionsยง

remove_if_exists
Remove a file if it exists; silently return Ok(()) if it does not.
write_atomic_restricted
Write contents to path atomically with file_mode, ensuring the parent directory exists and is set to dir_mode.