Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   read.3p    ( 3 )

читать из файла (read from a file)

Примеры (Examples)

Reading Data into a Buffer
       The following example reads data from the file associated with
       the file descriptor fd into the buffer pointed to by buf.

#include <sys/types.h> #include <unistd.h> ... char buf[20]; size_t nbytes; ssize_t bytes_read; int fd; ... nbytes = sizeof(buf); bytes_read = read(fd, buf, nbytes); ...