Re: pipe question



You want to set up a signal handler for SIGCHLD.  It will be called when a
child process dies.  Just call wait() to get the child's exit status, then
do something to make the rest of your program aware of that the child has
died (set a variable to something, or add an idle function).  The signal
handler should not run for too long though.

James.

--
Email: james@daa.com.au
WWW:   http://www.daa.com.au/~james/


On Mon, 2 Aug 1999, Fox, Kevin M wrote:

> I am writing a program that needs to spawn off a program, wait for it to
> finish, and then continue executing while still refreshing itself.
> I was thinking:
> 
> popen the program,
> have a timeout function that checks to see if the program has closed,
> continue when the program is done.
> 
> One problem.
> I need a function similar to pclose in that it checks to see if the pipe is
> closed, but does not wait for the program to close if the pipe is not
> closed.
> 
> Thanks,
> Kevin
> 
> 
> -- 
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]