From: Robert Klemme Date: 2003-09-19T01:14:45+09:00 Subject: Re: closing stderr "Michael Garriss" schrieb im Newsbeitrag news:3F69D414.70008@earthlink.net... > I would like to prevent some output that is going to stderr during a > call to a third party lib just during that call. My first guess was: > > STDERR.close_write > ThirdPartyLib::call_some_annoying_function > STDERR.???? > > I guess you can see my problem. Can anyone give me a lead on this? > > TIA, > Michael > > require 'StringIO' oldStdErr = $stderr oldSTDERR = STDERR $stderr = StringIO.new STDERR = $stderr begin # lib call ensure $stderr = oldStdErr STDERR = oldSTDERR end robert