Skip to main content

Module atomic_write

Module atomic_write 

Source
Expand description

Atomic file operations with cross-platform support (FR-FS)

This module provides atomic file write operations with:

  • Temporary file creation with fsync
  • Atomic rename (same filesystem)
  • Windows rename retry with exponential backoff (≤ 250ms total)
  • Cross-filesystem fallback (copy→fsync→replace)
  • Warning tracking for retries and fallbacks

Structs§

AtomicWriteResult
Result of an atomic write operation

Functions§

read_file_with_crlf_tolerance
Read a file with CRLF tolerance (FR-FS-005)
write_file_atomic
Atomically write content to a file using temp file + fsync + rename