I have a piece of code that has been running for a number of years, until
now. My vendor changed the way they created a program, and that new
program exits before its children's processes are finished. In the past,
the following "snippette" has worked fine for me:
my $progFullPath = "c:\\temp\\foobar.exe"; # Not the real program
my $commandLine = "foobar opt1 opt2"; # Again, just an example
my $ProcessObj;
Win32::Process::Create($ProcessObj,
$progFullPath,
$commandLine,
0,
NORMAL_PRIORITY_CLASS,
".")|| die print Win32::FormatMessage( Win32::GetLastError() );
while (!($done)) {
$done = 1 if ($ProcessObj->Wait(100));
$main->update; # TK update
}
As noted above, the "Wait(100)" would work fine if the parent program does
not exit prematurely. However, now that that is no longer true:
a) How do I determine all of the children processes on Windows
(specifically XP at this point)?
b) How do I wait until all children processes are finished?
I have been searching the web for various options for several hours, and
just cannot come up with one at this point. If anyone has any
suggestions, pointers, solutions, etc., I would be most appreciative of
your help.
Regards,
Michael Cohen
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs