Re: retrieving data from another process
- From: "Daniel Solaz" <dsolaz sistelcom com>
- To: gtk-list redhat com
- Subject: Re: retrieving data from another process
- Date: Tue, 21 Jul 1998 17:30:26 +0200
First question already answered by Eric Harlow.
Erik Greenwald wrote:
>My second question; I have to call another program (gcc) and
>get the output (STDOUT and STDERR) into data for my program.
>What would be the best way to approach this? is there a better
>way than to call the program redirecting to a /tmp file, then
>read that? I also need my program to stay functional while
>that runs, but know when the program terminates, is there a
>signal handler?
If you want to get both stdout AND stderr then popen() won't do; I guess
you'll need to fork() and then exec() just after redirecting streams as
desired with pipe()/dup(). You stop reading when you get EOF, no need
for handlers IMHO.
-Daniel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]