bfopen() - buffered file setup for files by filename
#include "bfile.h" #include "bfopen.h" int bfopen(BFILE *bfp, char *filename, char *mode);
The bfopen()
function makes a BFILE
object
refer to an open file by calling
bfsetup() with appropriate parameters.
filename is the name of
the file. Characters in mode are interpreted
independently as follows:
BFILE
which has been opened with this flag.
BFILE
which has been opened with this flag.
Exactly one of 'r', 'w', and 'u' must be included. 'a', 'c' and 't' are not permitted if 'r' is used.
The BFILE object must not have previously been successfully associated
with a file or other representation (i.e. none of bfopen()
,
bfopenhandle(),
and bfsetup()
can have been used unless they indicated failure). If
bfopen()
fails, it leaves the BFILE
object unchanged (so this error isn't 'sticky' and will not be
reported by the next call to
bferror()).
Returns 0
if successful, or an errno
value otherwise.
bfile(), bfile_dtor(), bfsetup(), bfread(), bfwrite(), bferror().
This function is part of the BFILE library.