Skip to main content

write_durable

Function write_durable 

Source
pub fn write_durable(path: &Path, data: &[u8]) -> Result<()>
Expand description

Replace path with data so a power cut leaves either the old file or the new one, never a truncated mix. The replacement keeps the target’s permissions when the target exists and is created 0644 otherwise. See write_atomic for the write sequence.