Skip to main content

Module fs_atomic

Module fs_atomic 

Source
Expand description

Cross-platform atomic file write: tempfile in same dir → fsync → persist → parent dir fsync. POSIX durability + Windows MoveFileEx semantics.

Functions§

atomic_write
Atomically write content to path. Uses a temp file in the same parent directory (avoids EXDEV on iCloud/Dropbox symlinks), fsyncs the file before persist, then fsyncs the parent directory for POSIX durability.