Re: Using Win32::Process::Create with multiple child processes.




<smudgef1@xxxxxxxxx> wrote in message

>
> Perl program A, creates process B;
> Perl program A waits for process B to terminate;
> Process B forks Process C; (probably similiar to an exec in perl)
> Process B terminates;
> Process A continues (but I want it to wait on Process C too!);
>
> BTW, process B and C are commerical applications that I don't have the
> source for, so I can't modify those.

I assume that B does something other than simply create C - otherwise you
could simply have A create C.

Maybe code it so that the first thing A does after B terminates is to
sleep() long enough for C to finish.
Is that feasible ?

Alternatively, if there's some way that A can get hold of C's pid, then you
can tell A to Wait() for C to finish (again, using Win32::Process).

Basically, if sleep()ing is not feasible, you need some way for A to be able
to find out when C has stopped - and the fact that A created B created C
does not guarantee that there's a simple way of achieving that.

Cheers,
Rob


.