fdstream.hpp: Classes for File Descriptors and File Handles |
[intro] [interface] [discussion] [code]
Please note: There is a more general solution proposed for boost, which I recommend using instead of this library.
These are classes for low-level I/O with file descriptors and file handles, which I (Nicolai Josuttis) partially introduced in my book The C++ Standard Library - A Tutorial and Reference. Note that this is not UNIX library. It's purpose is to provide a way to operate with any low level I/O library that uses file descriptors or things like that. In fact, you can also use this library to work with POSIX calls and/or file handles on Window systems.
The classes are:
The class provides the following interface:
under construction
I'd appreciate any constructive feedback. Please note: I don't have time to read all boost mails. Thus, to make sure that feedback arrives me, please send me a copy of each mail regarding this class.
The code is provided "as is" without expressed or implied warranty.
fdstream.hpp, the implementation of all classes:
fdstest1.cpp, a simple example using file descriptors 0 (standard input) and 1 (standard output):
fdstest2.cpp, another example using file descriptors opened with open():
fdstest3.cpp, another example starting a pipe with popen():
All files
[intro] [interface] [discussion] [code]