[lug] p2open()? Yet another C++ question

Scott A. Herod herod at interact-tv.com
Fri Aug 10 16:22:05 MDT 2001


Ahhh, I see what it's doing.  dup()'s the key.

Thanks,

Scott

"Riggs, Rob" wrote:
> 
> There is a Python module called popen2.py (it should be in
> /usr/lib/Python1.5) that does it in Python using Unix primitives, such as
> pipe(), dup(), fork(), exec(), etc. You should easily be able to translate
> that into C/C++ fairly quickly.
> 
> Or, hey, you could just write your code in Python instead. ;-)
> 
> -----Original Message-----
> From: Scott A. Herod [mailto:herod at interact-tv.com]
> Sent: Friday, August 10, 2001 3:57 PM
> To: lug at lug.boulder.co.us
> Subject: [lug] p2open()? Yet another C++ question
> 
> Hello,
> 
> On solaris and irix there is a p2open function that returns FILE
> pointers
> to both the input and output streams of a forked process.  This utility
> function doesn't seem to exist with gcc in linux.  popen is only one
> way.
> Any pointers on how to link to both stdin and stdout of a child process?
> 
> Thanks
> 
> Scott



More information about the LUG mailing list