write

Writes data to a file

int write (
        int fd ,
        char *buf,
        int n
)

Arguments

fd File descriptor
buf Pointer to data write buffer
n Number of bytes to write

Return Value

The number of bytes written up to normal termination is returned.
-1 is returned if an error occurred.

Explanation

The first n bytes from the buffer pointed to by buf are written to the file specified by fd.

See Also

open()