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(
    [in]    HANDLE hFile
);

Parameters

[in] hFile

Handle to the file to have its EOF position moved. The file handle must have been created with the GENERIC_WRITE access right.

Return Value

If the function succeeds, it returns a non-zero value. If the function fails, it returns 0 (zero). Call GetLastError to get extended error information.

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

wRTOS 1.0 SDK

windows.h

wRTOS_rtss.lib