[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'sysutils' (#rtl)

FileTruncate

Truncate an open file to a given size.

Declaration

Source position: filutilh.inc line 82

function FileTruncate(

  Handle: THandle;

  Size: LongInt

):Boolean;

Description

FileTruncatetruncates the file with handle Handleto Sizebytes. The file must have been opened for writing prior to this call. The function returns Trueis successful, Falseotherwise.

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 filehandle.

FileCreate

  

Create a new file and return a handle to it.

FileOpen

  

Open an existing file and return a filehandle

FileRead

  

Read data from a filehandle in a buffer.

FileSeek

  

Set the current file position on a file handle.