On Tue, 23 Aug 2011, Barry Brevik wrote:
> 
> I ALREADY HAVE some code that does this (see below). My question is- is
> there a way to periodically poll the outside process to determine if it
> is still running? I've tried a few things already and none of them work.


if (defined $process) {
    if ($process->GetExitCode() == Win32::Process::STILL_ACTIVE()) {
        # process is still running
        ...
    }
    else {
        # process has terminated; PID is still valid
        ...
        # release process handle so the OS can do full cleanup
        # of the already terminated process
        $process = undef;
    }
}

Cheers,
-Jan


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to