Expand description
Crash-safe persistence.
Never truncate-then-write: every overwrite goes through a temp file in the
same directory + fs::rename, so a crash mid-write leaves either the old
or the new content, never neither. Backups copy the original bytes
before the rename, mirroring the tree structure under --backup-dir.
Functionsยง
- atomic_
write - Atomically replace
pathwithbytes. - backup_
original - Copy the original bytes of
pathintobackup_dir, mirroring the tree structure relative toroot.