[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

IO.popen(ARRAY

Xavier Noria

7/9/2005 8:50:00 AM

I need to execute external programs and capture their stdout using
parameters from a web form. This is a web application that should be
portable to Mac OS X, Linux, *BSD, and Windows.

My understanding is that the natural way to implement this is to use
IO.popen(ARRAY), which the 2nd edition of the Pickaxe says it's going
into 1.9. Nevertheless it also says fork(2) is needed, and seems like
this is going to be the case in 1.9 as well, but this is not
mentioned explicitly. Will IO.popen(ARRAY) work on Windows in 1.9? If
not, which alternative would you consider?

-- fxn



1 Answer

Robert Klemme

7/9/2005 9:03:00 AM

0

Xavier Noria <fxn@hashref.com> wrote:
> I need to execute external programs and capture their stdout using
> parameters from a web form. This is a web application that should be
> portable to Mac OS X, Linux, *BSD, and Windows.
>
> My understanding is that the natural way to implement this is to use
> IO.popen(ARRAY), which the 2nd edition of the Pickaxe says it's going
> into 1.9. Nevertheless it also says fork(2) is needed, and seems like
> this is going to be the case in 1.9 as well, but this is not
> mentioned explicitly. Will IO.popen(ARRAY) work on Windows in 1.9? If
> not, which alternative would you consider?
>
> -- fxn

If you're using Ruby on cygwin I'm pretty sure that it'll work because
cygwin supports fork.

robert