Share via


FlushFileBuffers

This function clears the buffers for the specified file and causes all buffered data to be written to the file.

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 hFile is a handle to a communications device, the function only flushes the transmit buffer.

    If hFile is a handle to the server end of a named pipe, the function does not return until the client has read all buffered data from the pipe.

Return Values

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 operating system writes to disk on a regular basis. The FlushFileBuffers function writes all of the buffered information for the specified file to disk.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winbase.h   Coredll.lib, Fsmain.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetLastError, WriteFile

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.