I$Read

From NitrOS-9
Jump to: navigation, search
Read Read n bytes from a specified path
OS9 I$Read 103F 89

Entry Conditions

A path number

X address in which to store the data

Y number of bytes to read

Exit Conditions

Y number of bytes read

Error Output

CC carry set on error

B error code, if any

Additional Information

  • The Read call reads the specified number of bytes from the specified path. It returns the data exactly as read from the file/device without additional processing or editing. The path must be opened in the read or update mode.
  • If there is not enough data in the specified file to satisfy the read request, the read call reads fewer bytes than requested but an end-of-file error is not returned. After all data in file is read, the next I$Read call returns an end-of-file error.
  • If the specified file is open for update, the record read is locked out on RBF-type devices.
  • The keyboard terminate, keyboard interrupt, and end-of-file characters are filtered out of the Entry Conditions data on SCF-type devices unless the corresponding entries in the descriptor have been set to zero. You might want to modify the device descriptor so that these values are initialized to zero when the path is opened.
  • The call reads the number of bytes requested unless Read encounters any of the following:
    • An end-of-file character
    • An end-of-record character (SCF only)
    • An error