On 1/1/07, Robert James <srobertjames / gmail.com> wrote:
> What's the best way to see if a particular platform supports fork?  I
> know I could check if it's running on Windows, but I'd like something
> more direct (and presumably accurate).

You could test fork and see if you get a defined value back.

> A similar question: assuming a standard Ruby install (that is, no
> popen4), what's the most robust way of running a shell command and
> capturing STDOUT and STDERR?
> `command 2>&1` seems to not always work on Windows.

And it won't. That's bourne-shell syntax.

http://www.ruby-doc.org/stdlib/libdoc/open3/rdoc/index.html

Mike