From Appmethod Libraries
Jump to: navigation, search

Object Pascal

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 Object Pascal, do not mix routines that take or return file handles with those that use Object Pascal language file variables (typically seen as var F). To read from a file specified by a Object Pascal file variable, use the BlockRead procedure or the Read procedure instead.

See Also

Code Examples