From: John Kaurin Date: 2001-07-07T12:47:41+09:00 Subject: [ruby-talk:17448] Trashing $defout Sent this back when the gateway was broken, sorry if you have already seen it. I've seen a number of postings on how to redirect $defout or $stdout to the trash. Here is a little method that might prove useful. It was inspired by the "busy" method discussed in the Programming Book. I also wanted any input on whether this code might cause problems. Enjoy. ---------- def trash begin defout = $defout $defout = File.open('/dev/null', 'w+') yield ensure $defout.reopen(defout) end end ---------- Wrap your code up like this. trash do # Put code that needs to trash $defout or $stdout here. end