bfwrite() - buffered file write
#include "bfile.h"
int bfwrite(BFILE *bfp,
size_t *left,
void *ptr,
size_t size);
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().
Returns 0
if successful, or an errno
value otherwise.
bfile(), bfile_dtor(), bferror().
This function is part of the BFILE library.