Date: Tue, 10 Feb 1998 13:17:50 +0200 (IST) From: Eli Zaretskii To: Ali Bharmal cc: djgpp AT delorie DOT com Subject: Re: Capturing stdout using system In-Reply-To: <6bnsgl$p2u$1@lyra.csx.cam.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Mon, 9 Feb 1998, Ali Bharmal wrote: > The question is; how do I capture any screen output from these programs? Is > there an alternative to system() which pipes the output into a buffer, or am I > going to have to redirect output to a file which I then read. I'd rather the > former, as I'd like the program to be minimum-impact on the system. Use `popen' and `pclose' from the library, they will redirect the output and let you read it (assuming that the programs you run write to stdout using file I/O, not direct screen writes).