www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/10/06:22:11

Date: Tue, 10 Feb 1998 13:17:50 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Ali Bharmal <abharmal AT hotmail DOT com>
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: <Pine.SUN.3.91.980210131632.12622G-100000@is>
MIME-Version: 1.0

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).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019