From: Chris Gehlker Date: 2002-02-26T08:51:33+09:00 Subject: Re: Can't get stderr to flush (My Bad) On 2/25/02 3:13 PM, "Paul Brannan" wrote: > On Tue, Feb 26, 2002 at 06:41:49AM +0900, Chris Gehlker wrote: >> >> I've been messing around trying to run biorhythm.rb from the sample programs >> to run in RubyStudio. It just seems to ignore the value of $stderr.sync and >> not to respond to #flush. Either method works with stdout. > > Odd. What platform are you using? Mac > The C standard requires that standard error be either line buffered or > not buffered (it must not be fully buffered) by default. On Linux, > stderr is always unbuffered by default. It sounds like it defaults to > line buffered on your platform. It is line buffered, which is ok. My problem was that I got so wrapped up in making error messages a different color and highlighting the offending line in the source that I forgot to read the buffer before the Ruby program terminates. Doh. >> Is this a bug in ruby or in my understanding? >> >> BTW - Why does biorhythm.rb write user prompts to standard error anyway? > > Sounds like a bug in at least biorythm.rb (and perhaps also in Ruby). I hope biorhythm.rb is pathological. I really don't want to code for this case. -- In the midst of great joy, do not promise anyone anything. In the midst of great anger, do not answer anyone's letter. -Chinese proverb