System.SysUtils.FileRead

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

extern DELPHI_PACKAGE int __fastcall FileRead(Winapi::Windows::THandle Handle, void *Buffer, System::LongWord Count)/* overload */;

Properties

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

Description

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