Functions HI-TECH C READ

From HI-TECH C for CP/M Fan WIKI(EN)
Jump to: navigation, search



#include  <unixio.h>

int read(int fd, void * buf, size_t cnt)


Read() will read from the file associated with fd up to cnt bytes into a buffer located at buf. It returns the number of bytes actually read. A zero return indicates end-of-file. A negative return indicates error. Fd should have been obtained from a previous call to open(). It is possible for read() to return less bytes than requested, e.g. when reading from the console, in which case read() will read one line of input.


open, close, write