Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Giving status of a file..

by stephen (Priest)
on Apr 15, 2002 at 02:30 UTC ( #159069=note: print w/ replies, xml ) Need Help??


in reply to Giving status of a file..

I think kill is the way to go... If you have a bunch of PIDs, and want to see if they are running, you can do:

# untested my @proc_ids = (445, 320832, 38393, 327334); my @running = kill 0, @proc_ids;

kill won't kill the processes here. It will just return the process ID number if it is running.

Otherwise, you might want to check out Proc::Simple (which I suspect just uses kill behind the scenes, but don't know). Is there a particular reason you don't want to use kill?

stephen


Comment on Re: Giving status of a file..
Select or Download Code
Re: Re: Giving status of a file..
by Rhodium (Scribe) on Apr 15, 2002 at 03:25 UTC
    Hi Stephen,
    No, other than I don't want to kill the process.
    Thanks

    Rhodium

    The <it>seeker</it> of perl wisdom.

      Perhaps if you'd actually read the documentation for kill . . .

      Update: BECAUSE IF YOU'D READ THE DOCUMENTATION FOR kill YOU'D SEE THAT kill 0, $pid DOESN'T REALLY DO ANYTHING OTHER THAN MAKE SURE THAT THE PROCESS EXISTS.

      Sorry for not explicitly spelling that out for those down voting this. /me mourns the death of the Socratic method . . .

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://159069]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-09-21 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (169 votes), past polls