Unit 'AmigaDOS' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#morphunits]

dosRead

Read bytes of data from a file

Declaration

Source position: amigados.pas line 1635

function dosRead(

  fileh: LongInt;

  buffer: Pointer;

  length: LongInt

):LongInt;

Arguments

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