PStreams allows you to run another program from your C++ application and to transfer data between the two programs, similar to shell pipelines. In the simplest case, a PStreams class is like a C++ wrapper for the POSIX.2 functions popen(3) and pclose(3), using C++ IOStreams instead of C's stdio library. The library provides class templates in the style of the standard IOStreams that can be used with any standard-conforming C++ compiler on a POSIX platform. The classes use a streambuf class that uses fork() and the exec family of functions to create a new process and to write/read data to/from the process.
| Tags | Software Development Utilities |
|---|---|
| Licenses | LGPL |
| Operating Systems | POSIX |
| Implementation | C++ |
Recent releases


Release Notes: This release adds support for streambuf::in_avail() for platforms that support the FIONREAD ioctl request (known to work on Linux, FreeBSD, and Solaris). It is now possible to detect when the shell command failed to execute, as long as you open the pstream using the functions taking argv_type. If the command is not found or cannot be executed, pstreambuf::is_open() will return false. This makes it possible to distinguish the cases in which the command cannot be run and when it runs but exits with an error.


Release Notes: This release includes several non-trivial bugfixes and some minor code improvements. New argv_type and fd_type typedefs have been added (fd_t is deprecated). Documentation has been cleaned up to be more consistent and complete.


No changes have been submitted for this release.
A generic data structures library for C programmers.