Sign in Join
FPDoc Onlineexperiment

FileTruncate function

In unit sysutils

Truncate an open file to a given size.

Declaration

pascal
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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.