Module atomic

Module atomic 

Source
Expand description

Atomic file write + rename helpers. All registry mutations route through these so readers never observe a half-written file.

Functions§

rename_atomic
Atomic rename. Used for retire/unretire (same-directory tree).
write_atomic
Write bytes to path atomically: sibling temp file → fsync → rename over the target. Rename is atomic on every supported filesystem when source and destination live on the same volume, which is guaranteed here (sibling temp).