Unit 'sysutils' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

FileTruncate

Truncate an open file to a given size.

Declaration

Source position: filutilh.inc line 278

function FileTruncate(

  Handle: THandle;

  Size: Int64

):Boolean;

Description

FileTruncate truncates the file with handle Handle to Size bytes. The file must have been opened for writing prior to this call. The function returns True is successful, False otherwise.

For an example, see FileCreate.

Errors

On error, the function returns False.

See also

FileClose

  

Close a file handle.

FileWrite

  

Write data from a buffer to a given file handle.

FileCreate

  

Create a new file and return a handle to it.

FileOpen

  

Open an existing file and return a file handle.

FileRead

  

Read data from a file handle in a buffer.

FileSeek

  

Set the current file position on a file handle.


Documentation generated on: Oct 27 2024