From: Dalibor Sramek Date: 2002-11-08T17:05:07+09:00 Subject: Re: Changing ruby warning level On Fri, Nov 08, 2002 at 03:47:23AM +0900, Carl Youngblood wrote: > Okay, since I can't change the warning level to where I need it to be, is > there a way of temporarily redirecting output to /dev/null or something? > I'm not sure how to do that from inside a ruby script. Try: olderr = $stderr.clone $stderr.flush $stderr.reopen("/dev/null", "w") ... ... $stderr.flush $stderr.reopen(olderr) $olderr.close I believe "flush" should not be necessary but I needed it to make it work (very quick test on Windows Ruby 1.6.7). Dalibor Sramek