Skip to main content

write_file_atomic

Function write_file_atomic 

Source
pub fn write_file_atomic(
    path: &Path,
    bytes: &[u8],
    sync: bool,
) -> Result<(), PersistenceError>
Expand description

Atomically writes bytes to path via exclusive create_new sibling temp file -> optional sync_all -> rename -> optional parent-directory sync_all.