Process.waitpid(external pid)

Anybody know of a way in ruby to #waitpid on a non child process?

irb(main):001:0> Process.waitpid 32550
Errno::ECHILD: No child processes

[this is possible in doze with the win32-process gem, wondering about
linux now].
Thanks!
-r

···

--
Posted via http://www.ruby-forum.com/.

It seems unlikely in general -- waitpid, in POSIX land, really is specific
to your children.

Usually, the idiom is to send them signal 0 until it fails.

-s

···

On 2009-12-17, Roger Pack <rogerpack2005@gmail.com> wrote:

Anybody know of a way in ruby to #waitpid on a non child process?

--
Copyright 2009, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net
| Seebs.Net <-- lawsuits, religion, and funny pictures
Fair game (Scientology) - Wikipedia <-- get educated!

Anybody know of a way in ruby to #waitpid on a non child process?

It seems unlikely in general -- waitpid, in POSIX land, really is
specific
to your children.

Usually, the idiom is to send them signal 0 until it fails.

Excellent suggestion.
I have created a gem that does just that.

$ gem install wait_pid

provides you with this ruby code

require 'wait_pid'
WaitPid.wait_pid 1234

and this binary command

$ wait_pid pid_number

Works in both windows and linux.

Cheers!
-r

···

--
Posted via http://www.ruby-forum.com/\.