Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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
Replies are listed 'Best First'.
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 exploiting the Monastery: (7)
As of 2015-07-29 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls