Chapter 26. Input and Output

Table of Contents

Derived filebufs

Extensions allowing filebufs to be constructed from "C" types like FILE*s and file descriptors.

The v2 library included non-standard extensions to construct std::filebufs from C stdio types such as FILE*s and POSIX file descriptors. Today the recommended way to use stdio types with libstdc++ IOStreams is via the stdio_filebuf class (see below), but earlier releases provided slightly different mechanisms.

If you want to access a filebuf's file descriptor to implement file locking (e.g. using the fcntl() system call) then you might be interested in Henry Suter's RWLock class.