- Method write
Write data to a file or a stream.
If there are any file descriptors that have been queued for sending (with send_fd()), they will be sent.
Data to write.
datais an array of strings, they are written in sequence.
If more than one argument is given, sprintf() is used to format them using
formatis an array, the strings in it are concatenated and the result is used as format string.
The offset in data to start writing from.
dataand returns the number of bytes that were actually written.
The number of bytes successfully written to the OS buffers.
This can be less than the size of the given data if eg:
Some data was written successfully and then something went wrong.
If only some data was written due to an error and that error persists, then a later call to write() will fail and return
Nonblocking mode is used and not all data could be written without blocking.
No bytes were written. This may be due to
dataor the formatted data being the empty string.
Nonblocking mode is used and no data could be written without blocking.
Something went wrong and no bytes were written.
If everything went fine, a call to errno() directly afterwards returns zero.
The variant of this function using a buffer object does not release the interpreter lock.
- See also