Read bytes of data from a file
Source position: amigados.pas line 1635
function dosRead( |
fileh: LongInt; |
buffer: Pointer; |
length: LongInt |
):LongInt; |
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. |
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.
|
Open a file for input or output |
|
|
||
|
Write bytes of data to a file |
|
|
Set the current position for reading and writing |