2008/8/1 Michal Suchanek <hramrach / centrum.cz>:
> On 31/07/2008, Robert Klemme <shortcutter / googlemail.com> wrote:
>> On 31.07.2008 16:10, Michal Suchanek wrote:
>>
>> > I could not find any way to redirect input and output of programs in ruby.
>> >
>> > You can capture the fds but not redirect AFAICT.
>> >
>>
>>  You can - and it's pretty easy also.  The key feature to know is IO#reopen:
>
> Yes, this makes stuff much easier. Still to do what shell does when
> you use a shell pipe you need a working fork. I am not sure how fork
> is emulated on platforms that use spawn like Windows.

Well, I was actually on Windows (although I have to admit that I use
the cygwin version all the time). :-)

Can't remember: do IO.popen and friends work in the Windows version?
If it does, then you got your redirection with pipes already.

Kind regards

robert

-- 
use.inject do |as, often| as.you_can - without end