BFILE library

The BFILE library provides buffered access to open files or other objects which have similar semantics to files. It provides functionality similar to the fread() and fwrite() functions in the standard stdio library. Its main differences are:

Functions provided

The library can be regarded as implementing a class for general buffered access and two subclasses implementing buffered access for files specified by filename and for Windows HANDLEs.

Core functions in bfile.c:

Supplementary functions:

The BFILE library is distributed with Prosody which uses it in some of its high level libraries.