WRITE(2)

NAME
write - write on a file

SYNOPSIS
int write(fildes, buffer, nbytes)
char *buffer;

DESCRIPTION
Write writes nbytes bytes of data starting at buffer to the file associated with fildes at the file pointer location. The file pointer is advanced by the number of bytes written.

The number of characters actually written is returned. It should be regarded as an error if this is not the same as requested.

If fildes refers to an append-only file (see stat(2)), the file pointer is set to the end of the file before writing.

Writes which are aligned with file system blocks are more efficient than others; see filsys(5).

SEE ALSO
creat(2), open(2), pipe(2), select(2)

DIAGNOSTICS
EBADF, EFAULT, EINTR, EINVAL, EIO, ELAB, ENXIO, EPIPE, EROFS

BUGS
A write call may fail because of a prior call to lseek.