file-flag-write-through · shipping · also Windows write-through file flag

FILE_FLAG_WRITE_THROUGH

FILE_FLAG_WRITE_THROUGH is a Windows file-open flag that requests immediate propagation of writes instead of delayed cache writeback.

Write-through alone can still use the Windows system cache. FILE_FLAG_NO_BUFFERING independently bypasses that cache for file-data I/O; it does not affect disk hardware caching or memory-mapped files. Combining both flags bypasses the system cache and requests hardware-cache write-through, subject to device support. [1]

On NTFS, write-through also flushes metadata changes resulting from that request. NO_BUFFERING alone can leave metadata cached; use FlushFileBuffers when that metadata must be flushed. Unbuffered file I/O also requires appropriate transfer-size, offset and buffer-address alignment. Neither flag supplies multi-operation atomicity. [1] [2] [3]

Relations

related
FlushFileBuffers, FlushViewOfFile, Write-through cache, Direct I/O, Storage cache flush, FILE_FLAG_NO_BUFFERING

Citations

  1. Microsoft: CreateFileA, Caching Behavior and independent file flags (accessed 2026-11-14)
  2. Microsoft: File Caching, write-through and metadata (accessed 2026-11-14)
  3. Microsoft: File Buffering, alignment and hardware-cache scope (accessed 2026-11-14)

Further reading

  1. Hesela: Windows mapped-file synchronization and cache boundaries (accessed 2026-11-14)
Sources & caveats
  • Microsoft Win32 documentation reviewed 14 November 2026; no Windows runtime, power-loss or remote-server experiment was performed.
  • Related POSIX and Linux APIs are comparisons, not claims of equivalent completion or error semantics.

JSON: /data/terms/file-flag-write-through.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. FILE_FLAG_WRITE_THROUGH. Hesela. 2026-11-14. https://hesela.dev/terms/file-flag-write-through/