views:

68

answers:

2

is it possible to turn pipes genereated via pipe() on a POSIX-system into std::istreams and std::ostreams? if yes, how?

i would prefer to use << and >> instead of read() and write()

thanks in advance

+3  A: 

There are non-standard constructors which take file descriptor number or FILE*. See http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a00074.html

liori
+1  A: 

Check out http://www.netbsd.org/~jmmv/process/ and http://www.highscore.de/boost/process/

EDIT http://svn.boost.org/svn/boost/sandbox/process/

I forget which one hosts the latest source, but it's a very good cross-platform IPC library with support for pipes.

It's not actually part of boost but they want (or wanted) it to be.

SilverSun