A
ara.t.howard
on *nix i use this
#
# returns true if pid is running, false otherwise
#
def alive pid
#--{{{
pid = Integer("#{ pid }")
begin
Process::kill 0, pid
true
rescue Errno::ESRCH
false
end
#--}}}
end
alias alive? alive
export 'alive', 'alive?'
i expect it won't work on windows but maybe i'm wrong? if so can
someone suggest code to accomplish this task?
cheers.
a @ http://drawohara.com/
#
# returns true if pid is running, false otherwise
#
def alive pid
#--{{{
pid = Integer("#{ pid }")
begin
Process::kill 0, pid
true
rescue Errno::ESRCH
false
end
#--}}}
end
alias alive? alive
export 'alive', 'alive?'
i expect it won't work on windows but maybe i'm wrong? if so can
someone suggest code to accomplish this task?
cheers.
a @ http://drawohara.com/