Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#aros]

DOSRead

Read bytes of data from a file

Declaration

Source position: amigados.pas line 2207

function DOSRead(

  File_: Pointer;

  Buffer: Pointer;

  Length: LongInt

):LongInt;

Arguments

File_

  

File handle

Buffer

  

Pointer to the buffer for the data

Length

  

number of bytes to read. The filesystem is advised to try to fulfill the request as good as possible.

Description

Data can be copied using a combination of DOSRead() and DOSWrite(). DosRead() reads bytes of information from an opened file (represented here by the argument file) into the buffer given. The argument length is the length of the buffer given.

The value returned is the length of the information actually read. So, when result is greater than 0, the value of result is the the number of characters read. Usually DosRead() will try to fill up your buffer before returning. A value of 0 means that end-of-file has been reached. Errors are indicated by a value of -1.

See also

DosOpen

  

Open a file for input or output

DosClose

  

DosWrite

  

Write bytes of data to a file

DosSeek

  

Set the current position for reading and writing


Documentation generated on: 2021-07-30