flush-view-of-file · shipping · also Windows mapped-view flush

FlushViewOfFile

FlushViewOfFile initiates writeback of dirty pages in a selected range of a Windows file mapping.

The call covers dirty mapped pages, not file metadata, and does not wait for the hardware disk cache to reach persistent media. The documented sequence for both boundaries is FlushViewOfFile followed by FlushFileBuffers. Both calls return nonzero on success and zero on failure; inspect GetLastError on failure. [1] [2]

A zero length flushes from the supplied address to the end of the mapping. Network completion does not establish remote persistence. Mapped writes may also leave the last-modification timestamp unchanged; SetFileTime is a separate operation when an update is required. [1]

Relations

related
FlushFileBuffers, FILE_FLAG_WRITE_THROUGH, Memory-mapped file, msync, SMB FLUSH, FILE_FLAG_NO_BUFFERING

Citations

  1. Microsoft: FlushViewOfFile, mapped pages and persistence boundaries (accessed 2026-11-14)
  2. Microsoft: FlushFileBuffers, parameters, return value and remarks (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/flush-view-of-file.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. FlushViewOfFile. Hesela. 2026-11-14. https://hesela.dev/terms/flush-view-of-file/