BFILE library: bfwrite() - buffered file write

Name

bfwrite() - buffered file write

Synopsis

#include "bfile.h"

int bfwrite(BFILE *bfp, size_t *left, void *ptr, size_t size);

Decription

The bfwrite function writes data to an open file. The BFILE must have been set up with bfsetup() and must not be in an error condition. Up to size bytes from the memory area pointed to by ptr are written. All the data is written unless an error occurs. The number of bytes not written is stored at *left so this is zero if the function returns zero (i.e. no error). However, a non-zero return value does not necessarily indicate that any data remains unwritten. If an error occurs, the BFILE is put into an error condition, which can only be cleared by bferror().

Return value

Returns 0 if successful, or an errno value otherwise.

See also

bfile(), bfile_dtor(), bferror().


This function is part of the BFILE library.