ReadReadlnread from a filereadint pnchar *bufferint countreadlnint pnchar *bufferint countAssembler Equivalent
os9 I$READ
os9 I$READLN
Description
The path number, "pn" is an integer which is one of the
standard path numbers 0, 1, or 2, or the path number should
have been returned by a successful call to "open", "creat", or
"dup". "Buffer" is a pointer to space with at least "count"
bytes of memory into which read will put the data from the
file.
It is guaranteed that at most "count" bytes will be read, but
often less will be, either because, for readln, the file
represents a terminal and input stops at the end of a line, or
for both, end-of-file has been reached.
Readln causes "line-editing" such as echoin to take place and
returns once the first "\n" is encountered in the input or the
number of bytes requested has been read. Readln is the
preferred call for reading from the user's terminal.
Read does not cause any such editing. See the OS-9 manual for
a fuller description of the actions of these calls.
Diagnostics
Read and readln return the number of bytes actually read (0 at
end-of-file) or -1 for physical i/o errors, a bad path number,
or a ridicolous "count".
NOTE that end-of-file is not considered an error, and no error
indication is returned. Zero is returned on EOF.
See Also
open(),
creat(),
dup()