From: Matt Armstrong Date: 2002-03-12T23:24:31+09:00 Subject: Re: write a stream to another Thomas S�ndergaard writes: >> > I would probably just use: >> >> [...] >> >> > istream.each { |line| >> > ostream.write line >> > } >> >> Agreed. Or a bit more efficient: >> >> while buf = istream.read(4096) >> ostream.write(buf) >> end > > You're not thinking declaratively ;-) I want to say what I want it > to do. Not how to do it. > > ostream << istream > > seems about right to me. Sure, you're talking API and I'm talking implementation. Your IO#<< could be implemented with the while loop. -- matt