Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 avoiding work at the Monastery: (10)
As of 2016-02-12 10:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (395 votes), past polls