Share via


FlushFileBuffers (Compact 2013)

3/26/2014

This function clears the buffers for the specified file and writes all buffered data to the file.

Syntax

BOOL WINAPI FlushFileBuffers(
  HANDLE hFile 
); 

Parameters

  • hFile
    [in] Handle to an open file. The function flushes this file's buffers. The file handle must have GENERIC_WRITE access to the file.

    If this parameter is a handle to a communications device, the function only flushes the transmit buffer.

Return Value

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

The WriteFile function typically writes data to an internal buffer that the OS writes to disk on a regular basis. This function writes the buffered information for the specified file to disk.

Requirements

Header

winbase.h

Library

coredll.lib

See Also

Reference

File I/O Functions
WriteFile