[EMAIL PROTECTED] writes:
> **
> ** Before I go off and try and make my spawn wrapper compatible with the
> existing waitpid.
> **  Let me ask the basic question ,
> **     I need to execute some  commands ( mostly Java) capture the
> sys$output ( and possible sys$error), make sure the
> ** comand ran ( process is running)  and then either  wait for completion
> or go off and do other things ( like launch other processes )
> ** and finaly come back and kill the "process" ( or wait for completion and
> capture the exit status) after a period.
> **
> ** Now
> **        1. System
> **        2. open(FOO, "java ...|") requires while(FOO) to catch output
> **        3. `java this`
> **   will all create seperate processes , but all seem to operate in a
> largely spawn/wait mode
> **           so is there an equivalent of  spawn/nowait ?
>

#2 is closest to what you want.  #1 and #3 both wait for subprocess
completion.   With #2 you can start the subprocess, go do other things
for a while, pick up some output, do more stuff, wait for subprocess
completion, then pick up the final output and status.

So you'll have to think carefully about the sequence of events and
how you synchronize between child and parent processes, but you should
have enough flexibility to do what you need.
--
 Drexel University       \V                    --Chuck Lane
======]---------->--------*------------<-------[===========
     (215) 895-1545     _/ \  Particle Physics
FAX: (215) 895-5934     /\ /~~~~~~~~~~~        [EMAIL PROTECTED]

Reply via email to