-
Capturing from stdout
Wow, it HAS been a while since I last came in here! This place really IS different!... I could sit and say stories about this place :D, but I don't want to anyways.
I want to make a program that spawns a second program, I actually want the first program to capture what the second one outputted to the screen. The code has to be completely ANSI compliant, since it's going to be written for windows, linux AND FreeBSD...
Does anybody know how to do something like this?
Chhers
Oskilian
-
> The code has to be completely ANSI compliant
ANSI only gives you stdio, it doesn't say what happens on the other side of the stream.
Next best bet is POSIX (which I think covers you)
popen() allows you to run a process, and capture one of its stdio streams
http://sdx1.uky.edu/cgi-bin/man.cgi?...ll&topic=popen
Even then, its probably worth keeping the part of the code which does this in its own neat little corner to minimise porting problems.