From: ahoward Date: 2003-05-10T02:00:21+09:00 Subject: Re: extern "C" of prep_stdio On Sat, 10 May 2003, ts wrote: > > [[ spamassassin definetely think that you are a spammer :-)) ]] > > >>>>> "S" == Simon Strandgaard <0bz63fz3m1qt3001@sneakemail.com> writes: > > S> VALUE w = rb_class_new_instance(2, params, klass); > > S> rb_defout = rb_stdout = rb_stderr = w; // Is this correct ??? > > no, you must call IO#reopen in several of the recent threads on io redirection i have been admonished for suggesting the use of reopen and told to use assignment $defout = $stdout = $stderr = redirected_io_object instead. now, i personally have had much better luck using #reopen, but i'm curious as to your rational. since using reopen can cause a broken pipe to feeder/feeding processes, and it makes it harder to restore io objects to original condition (though not by much). am i the only one out here who thinks an RCR for a suite of common redirect methods seems reasonable? there are few topics which have caused so much confusion/discussion on this list - well, maybe 'class << self'... ;-) -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ara.t.howard@fsl.noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 ====================================