Windows x64 transactional file replacement (#3) #19

Merged
faumaray merged 1 commits from issue/3-windows-transactional-replace into main 2026-12-03 08:08:02 +00:00
Owner

Closes #3.

Branch issue/3-windows-transactional-replace targeting main. Summary, tests and the documented contracts are in the commit message and the issue comment.

Closes #3. Branch `issue/3-windows-transactional-replace` targeting `main`. Summary, tests and the documented contracts are in the commit message and the issue comment.
faumaray added 1 commit 2026-12-03 06:49:16 +00:00
- replace_file/atomic_write gain a Win32 implementation: exclusive
  CREATE_NEW staging in the destination directory, WriteFile loop,
  FlushFileBuffers for durable_sync, MoveFileExW(MOVEFILE_REPLACE_EXISTING
  [| MOVEFILE_WRITE_THROUGH]) for atomic publication and a parent-directory
  flush for durability.
- read_file_bounded/write_file implemented on Windows so the contract is
  usable and testable there.
- Documented Windows guarantees per durability level, including the
  application-crash vs power-loss distinction and post-rename failure
  reporting (sync_parent + visible_on_disk + durability_unknown).
- Added a portable contract test (first creation, replacement, Unicode
  name, pre-publication faults preserving old contents, post-publication
  fault reporting, no staging leftovers, live destination never deleted)
  and a concurrent-writer atomicity test.
faumaray merged commit dc18d64b18 into main 2026-12-03 08:08:02 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Void/Library#19