file-flag-no-buffering · shipping · also Windows unbuffered file I/O

FILE_FLAG_NO_BUFFERING

FILE_FLAG_NO_BUFFERING is a Windows CreateFile flag that disables system caching for data reads and writes through the opened file or device handle.

The flag does not change hardware disk caching or memory-mapped access. File metadata may still be cached; FlushFileBuffers addresses that separate boundary. Cache bypass alone is not a durability guarantee. [1] [2]

For seekable files, transfer lengths and offsets must be multiples of the volume's logical sector size. The documentation separately recommends physical-sector alignment for unbuffered I/O, including buffer addresses. An aligned allocation does not validate the request length or offset. Query the actual geometry instead of assuming 512 or 4096 bytes. [3]

STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR reports BytesPerLogicalSector, BytesPerPhysicalSector and BytesOffsetForSectorAlignment. The last field locates the first logical sector within a physical sector; it is not an application-buffer address. [4]

FILE_FLAG_WRITE_THROUGH is independent and can be combined with NO_BUFFERING. The combination also requests hardware-cache write-through, subject to device support. Neither alignment nor cache bypass supplies a multi-operation transaction. [1]

Relations

related
FILE_FLAG_WRITE_THROUGH, FlushFileBuffers, FlushViewOfFile, Direct I/O, Direct-I/O alignment, 512e emulation, 4Kn native sectors

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)
  4. Microsoft: STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR, logical and physical sector geometry (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-no-buffering.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. FILE_FLAG_NO_BUFFERING. Hesela. 2026-11-14. https://hesela.dev/terms/file-flag-no-buffering/