BFILE library: bfopenhandle() - buffered file setup for Windows HANDLEs

Name

bfopenhandle() - buffered file setup for Windows HANDLEs

Synopsis

#include "bfile.h"
#include "libutil/WINNT/bfhandle.h"

int bfopenhandle(BFILE *bfp,
	HANDLE h);

Decription

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()).

Return value

Returns 0 if successful, or an errno value otherwise.

See also

bfile(), bfile_dtor(), bfsetup(), bfread(), bfwrite(), bferror().


This function is part of the BFILE library.