bfopenhandle() - buffered file setup for Windows HANDLEs
#include "bfile.h" #include "libutil/WINNT/bfhandle.h" int bfopenhandle(BFILE *bfp, HANDLE h);
The bfopenhandle()
function makes a BFILE
object
refer to an open file by calling
bfsetup() with appropriate parameters.
h is an open Windows HANDLE to the file.
The BFILE object must not have previously been successfully associated
with a file or other representation (i.e. none of
bfopenhandle()
,
bfopen(),
and bfsetup()
can have been used unless they indicated failure). If
bfopenhandle()
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.