Alternate Entry: RAW.RD
B: status = read( [unit,] buffer [, sector [, nwds] ] );
C: int read( [FILE *unit,] void *buffer, [int sector[, int nwds]]);
READ performs binary I/O on random or sequential disk files or tapes which have been opened by a call to OPEN. Buffer Sizes: For a random disk file, "nwds" may be any non-zero value. However, if it is not a multiple of 64 when writing, the hardware will fill the remainder of the last sector with zeroes. The file pointer will be advanced (words+63)/64 sectors (where "words" is the number of words transfered, normally "nwds").
For a sequential disk file, "nwds" would normally be a non-zero multiple of 320. It must be less than or equal to 20160 (63 llinks). The file pointer will be advanced by (words+319)/320 llinks (where "words" is the number of words read, normally "nwds").
For a tape, "nwds" must be a non-zero value.
READ may return zero, indicating that an EOF was encountered. A second read at the same location will raise a physical EOF error.
When "status" is negative indicating an error was raised, and the file was opened with the "e" option, the A-register will contain the number of words transfered before the error. B users can retrieve this with a call to .NULL; C users can define the functions as returning a two-word struct.
When "unit" is in an error state, a call to READ will fail immediately without actually attempting a new I/O. Any error must be cleared from the unit before a call to READ can proceed.
Copyright © 1993,1997 Thinkage Ltd.