pub fn atomic_write(path: &str, content: &str) -> Result<(), String>Expand description
Atomic file write: write to temp file, fsync, then rename. Prevents partial-write corruption on crash or power loss. D31: Single handle — write, sync, rename in one file open.