SetEndOfFile

The SetEndOfFile function moves the end-of-file (EOF) position for the specified file to the current position of the file pointer.

Syntax

Copy
BOOL SetEndOfFile(
    HANDLE hFile
);

Parameters

hFile

A handle to the file to have its EOF position moved.

Return Value

If the function succeeds, it returns a non-zero value. If the function fails, it returns 0 (zero) .

To get extended error information, call GetLastError.

Remarks

This function can be used to truncate or extend a file. If the file is extended, the contents of the file between the old EOF position and the new position are not defined.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

windows.h rtkrnl.lib