Skip to main content

write_text_atomic

Function write_text_atomic 

Source
pub fn write_text_atomic(path: &Path, text: &str) -> Result<()>
Expand description

Write text through a temporary file and rename, so a kill cannot leave a truncated file behind.

The follow-up queue is the one file spar rewrites in place rather than appends to, and a truncated queue is lost work: what it held was never written anywhere else.