From: Michal Suchanek Date: 2008-08-01T08:10:30+09:00 Subject: Re: Input redirection in ruby On 31/07/2008, Robert Klemme 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. According to porting tutorials passing the fd's is possible with the windows API but doing a full fork() is hard - it normally requires copying the whole address space manually because part of the NT core functionality is not exposed in the Win32 API. Thanks Michal