SetFileSizeDirect Method
Resizes a file by passing the request directly to the filesystem.
function SetFileSizeDirect(FileHandle: Int64; Size: Int64): Boolean;
Remarks
Applications can call this method in filesystem-related event handlers to resize a file without sending the request through the filesystem filter driver stack. If the file is resized successfully, this method returns True; otherwise, it returns False.
The FileHandle parameter specifies the file that should be resized. The value passed for this parameter must be a file handle obtained from the CreateFileDirect method; please refer to its documentation for more information.
The Size parameter specifies the new file size, in bytes.
Note: This method can only be called within events.