Expand description
Whole-file writes that a crash or a concurrent writer cannot leave half done: the contents go to a temporary file beside the target, are synced, and only then take the target’s name.
Enums§
- Access
- Who may read a file written here.
Functions§
- replace
- Writes
contentstopath, replacing any file there, atomically: a rename of a synced temporary file, so a reader sees the old contents or the new, never part of either. Parent directories are created. - write_
new - Writes
contentstopathunless a file is there, atomically: a hard link from a synced temporary file, which fails whenpathexists, so an existing file is never replaced and of two concurrent writers exactly one wins. Parent directories are created.