From: Robert Klemme Date: 2004-05-19T04:08:50+09:00 Subject: Re: stream filtering "ts" schrieb im Newsbeitrag news:200405181548.i4IFmAX17388@moulon.inra.fr... > >>>>> "R" == Ryan Paul writes: > > R> printed text. If it is possible, I would really appreciate a sample. If it > > Something like this ? > > svg% cat b.rb > #!/usr/bin/ruby > class A > def initialize > @io = File.new("aa", "w") > end > > def write(mess) > @io.write(mess) > end > end > > $stdout = A.new > puts "hello" > svg% > > svg% b.rb > svg% > > svg% cat aa > hello > svg% I thoughz #reopen was considered better because it keeps the reference to the same instance: $stdout.reopen( File.open("foo", "w") ) puts "hallo" Regards robert