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

GetFileContents

Return the contents of a file as an array of bytes.

Declaration

Source position: filutilh.inc line 288

function GetFileContents(

  const aFileName: RawByteString

):TBytes;

function GetFileContents(

  const aFileName: UnicodeString

):TBytes;

function GetFileContents(

  const aHandle: THandle

):TBytes;

Description

GetFileContents returns the contents of aFileName or aHandle as an array of bytes. The whole file is read in the case of aHandle: The file position is first set to offset zero.

Errors

If an invalid file handle or a file handle that does not support the seek operation, a EInOutError exception is raised.

See also

GetFileAsString

  

Return the contents of a file as a string.


Documentation generated on: Jul 24 2023