Hi all -
I've been playing around a bit with Quixote, Durus, and Dulcinea. I'm
working on a variety of BSD-based machines (NetBSD, FreeBSD, OS X), and I
noticed that there are two Linux-specific hacks in Dulcinea. I don't know
the best way to submit a patch, but here's an alternate is_running (from
the 'site' script) that should work on BSD systems, assuming that 'ps' is
in your path. Should work in Linux too, but will obviously be slower than
the existing implementation.
In case anyone is interested, here it is:
def is_running(pid):
"""Return true if program with 'pid' exists."""
from popen2 import popen2
i,o = popen2("ps ax")
ret = False
for s in i.readlines():
if pid == s.split()[0]:
ret = True
break
i.close()
o.close()
return ret
Michael