From RAD Studio API Documentation
Jump to: navigation, search


function FileRead(Handle: THandle; var Buffer; Count: LongWord): Integer;
function FileRead(Handle: THandle; var Buffer: TBytes; Offset, Count: LongWord): Integer;


extern DELPHI_PACKAGE int __fastcall FileRead(NativeUInt Handle, void *Buffer, unsigned Count)/* overload */;


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


Reads a specified number of bytes from a file.

FileRead reads Count bytes from the file specified by Handle into the buffer. The Count parameter indicates the size, in bytes, of the buffer. The function result is the actual number of bytes read, which may be less than Count. The Handle that is passed to FileRead must be opened with FileOpen or FileCreate.

Note: In Delphi, do not mix routines that take or return file handles with those that use Delphi language file variables (typically seen as var F). To read from a file specified by a Delphi file variable, use the BlockRead procedure or the Read procedure instead.

See Also

Code Examples