From: Paul Brannan Date: 2001-09-21T04:38:06+09:00 Subject: [ruby-talk:21455] Re: Interaction system() / $stdout ? On Fri, 21 Sep 2001, Johan Holmberg wrote: > system "echo In the beginning, to STDOUT I hope." > > $saved_stdout = $stdout > $stdout = File.open("log-file", "w") > > system "echo After redirect, to log-file I hope." > > $stdout = $saved_stdout > > system "echo Original restored, to STDOUT I hope." Try changing: $saved_stdout = $stdout to: $saved_stdout = $stdout.clone Paul