Go to the first, previous, next, last section, table of contents.


write

Syntax

#include <unistd.h>

int write(int file, const void *buffer, unsigned count);

Description

This function writes count bytes from buffer to file. It returns the number of bytes actually written. It will return zero if the disk is full, and may return less than count even under valid conditions.

Note that if file is a text file, write may write more bytes than it reports.

If count is zero, the function does nothing and returns zero. Use _write if you want to actually ask dos to write zero bytes.

Return Value

The number of bytes written, zero at EOF, or -1 on error.

Portability

not ANSI, POSIX

Example

write(fd, "hello", 5);


Go to the first, previous, next, last section, table of contents.