{
  "slug": "flush-file-buffers",
  "term": "FlushFileBuffers",
  "aliases": [
    "Windows file buffer flush"
  ],
  "definition": "FlushFileBuffers requests that buffered information for an open Windows file be written to its underlying device.",
  "note": "For an ordinary file, the handle requires GENERIC_WRITE. A nonzero return reports success; zero requires inspecting GetLastError. Named-pipe handles have a different completion contract: a server-side call waits for the client to read the buffered data. [windows-flush-file]\n\nFor mapped writes, use FlushViewOfFile followed by FlushFileBuffers to cover dirty mapped pages, file metadata and the documented disk-persistence boundary. Check both results. This sequence is not a multi-write transaction or a substitute for coordinating concurrent writers. [windows-flush-view]",
  "related": [
    "flush-view-of-file",
    "file-flag-write-through",
    "fsync",
    "memory-mapped-file",
    "cache-flush",
    "file-flag-no-buffering"
  ],
  "citations": [
    {
      "id": "windows-flush-file",
      "title": "Microsoft: FlushFileBuffers, parameters, return value and remarks",
      "url": "https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-flushfilebuffers",
      "accessed": "2026-11-14"
    },
    {
      "id": "windows-flush-view",
      "title": "Microsoft: FlushViewOfFile, mapped pages and persistence boundaries",
      "url": "https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-flushviewoffile",
      "accessed": "2026-11-14"
    },
    {
      "id": "hesela-windows-flush",
      "title": "Hesela: Windows mapped-file synchronization and cache boundaries",
      "url": "https://hesela.com/analyses/mmap-visibility-size-durability/#windows-flush",
      "accessed": "2026-11-14"
    }
  ],
  "provenance": [
    "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."
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-14"
}
