An application can truncate or extend a file by calling SetEndOfFile. This function sets the end-of-file marker to the current position of the file pointer.
Note that when a file is extended, the contents between the old and new end-of-file locations are not defined.
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
