You could use Win32::Process::Wait(0) to poll the process.

John

On Thu, May 18, 2000 at 03:09:32PM -0400, Cameron, Thomas P wrote:
> I too am interested in this.  I'm firing off a number of processes on NT
> using Win32::Process::Create() and later I want to detect If the process is
> running or not, and if not, what the exit code was.  I've tried
> GetExitCode() which seems to work if the process has died, but it is not
> documented what is supposed to happen if the process is still running.  It
> seems to consistently return a value of 259 in this case, but I don't what
> this means.
> 
> Any ideas?
> 
> -Tom
> 
> -----Original Message-----
> From: Ben Conrad [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 17, 2000 3:14 PM
> To: Perl-Win32-Users Mailing List
> Subject: Win32::Process (concurrent processes)
> 
> 
> Hello,
> 
> I'm dumping eventlogs from various NT machines around my network.  I would
> like to be able to run 2 or more "dumps" at the same time, when the 2
> "dumps" are done I want to loop all over again.
> 
> I'm just doing a simple test by running 2 notepads.
> 
> use Win32::Process
> Win32::Process::Create($ProcessObj,"c:/winnt/system32/notepad.exe",
>       "notepad",0,NORMAL_PRIORITY_CLASS,".") || die "Create: $!";
> Win32::Process::Create($ProcessObj,"c:/winnt/system32/notepad.exe",
>       "notepad",0,NORMAL_PRIORITY_CLASS,".") || die "Create: $!";
> 
> The perl script runs, launches the 2 notepads and then the perl script
> finishes (seems OK).  What I would like to do is to run the 2 notepads in
> parallel and then wait to make sure that both are done (using a loop with
> sleep?).  Once the 2 processes are done I want to do the same thing again.
> 
> What is the correct way to 
> 1.) check to see if the processes are done?
> 2.) loop to check for #1?
> 3.) Make global variables I'm using in my script available to the processes?
> 
> Thanks much, I've looked at Win32::Process (html) but I need some more help.
> 
> Ben.
> 
> ____________________________________
>  Ben Conrad
>  NT Administrator, NOS Team
>  GENUITY INC.
>  617.873.5146
>  [EMAIL PROTECTED]
> ____________________________________ 
>    
> 
> ---
> You are currently subscribed to perl-win32-users as: [EMAIL PROTECTED]
> To unsubscribe, forward this message to
>          [EMAIL PROTECTED]
> For non-automated Mailing List support, send email to  
>          [EMAIL PROTECTED]
> 
> ---
> You are currently subscribed to perl-win32-users as: [EMAIL PROTECTED]
> To unsubscribe, forward this message to
>          [EMAIL PROTECTED]
> For non-automated Mailing List support, send email to  
>          [EMAIL PROTECTED]
> 

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to