From: "Jan Dubois" <[email protected]> > On Mon, 05 Apr 2010, Octavian Rasnita wrote: >> I have tried for too many times with wrong results, so I doubt that >> exactly >> that process ID gets used each time. >> >> But I have tried the following program which always work: >> >> use Win32::Process::Info; >> >> my $pid = 3272; >> >> my @pids = Win32::Process::Info->new->ListPids; >> >> print grep($_ == $pid, @pids) ? 'yes' : 'no'; > > Not sure what you are trying to say here. Are you saying that > kill(0, $pid) will return '1' for *any* value of $pid?
No, it returns 1 for the processes that just ended (but a pretty long time after those processes were killed). I have made a program that runs for a longer time: $|++; print $$; sleep 60; Then I get the returned PID and I use it in the following program: my $pid = 3764; print kill(0, $pid); While the first program is running, the second program prints 1. Right after the first program ended, the second program continues to print 1 although there is no process with that PID running (I tested this by using the program I included in my previous message). I have just tested this on another computer which also runs Windows XP Pro (installed for only few days). I run it with a username other than "Administrator" but with administrative privileges. Thanks. Octavian __________ Information from ESET NOD32 Antivirus, version of virus signature database 5003 (20100406) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com _______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
