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
- Microsoft: CreateFileA, Caching Behavior and independent file flags
- Microsoft: File Caching, write-through and metadata
- Microsoft: File Buffering, alignment and hardware-cache scope
- Microsoft: STORAGE_ACCESS_ALIGNMENT_DESCRIPTOR, logical and physical sector geometry
Further reading
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.