Expand description
Crash-safe atomic file writes — re-exported from par-term-config.
The implementation lives in par_term_config::atomic_save. It had to move
out of the root crate because par-term-config, par-term-settings-ui and
par-term-update all write files that must be atomic and none of them can
depend on the root crate; a Layer-1 home is the only one all four can reach.
Duplicating a security-sensitive write path into a second crate was the
alternative and was rejected.
This module stays so that existing crate::atomic_save::… call sites keep
working. See the upstream module for the durability and permission
contracts, including when to prefer save_string_atomic_preserving_mode
over the 0o600-forcing variants.
Functions§
- save_
bytes_ atomic - Atomically replace
pathwithbytes, forcing mode0o600. - save_
bytes_ atomic_ preserving_ mode - Atomically replace
pathwithbytes, keeping the target’s current mode. - save_
string_ atomic - Atomically replace
pathwithcontents, forcing mode0o600. - save_
string_ atomic_ preserving_ mode - Atomically replace
pathwithcontents, keeping the target’s current mode. - save_
yaml_ atomic - Serialize
valueas YAML and atomically replacepathwith it, forcing mode0o600.