Skip to content

feat(storage): implement Windows directory synchronization (FlushFileBuffers) #3898

Description

@0xMudit

Summary

On Windows, \syncDirectory()\ is a no-op, meaning directory-level durability guarantees are weaker than on POSIX. Newly created/renamed/linked/removed entries may not survive power loss.

Current State

  • **\docs/windows-support.md:193-199**: Documents the gap
  • No implementation exists for Windows directory synchronization

Proposed Solution

  1. Implement Windows directory synchronization using \FlushFileBuffers\ on directory handles
  2. Use \CreateFile\ with \FILE_FLAG_WRITE_THROUGH\ for directory handles
  3. Call \FlushFileBuffers\ after directory operations
  4. Document the durability boundary for Windows

Acceptance Criteria

  • \syncDirectory()\ works on Windows
  • Directory operations are durable across power loss
  • Performance impact is acceptable
  • Documentation updated

Labels

enhancement, help wanted

Metadata

Metadata

Assignees

Labels

enhancementhelp wanted

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions