From: Eric Schwartz Date: 2002-11-16T05:03:42+09:00 Subject: Re: Problem writing to file after closing $stdout & $stderr ahoward writes: > On 15 Nov 2002, Eric Schwartz wrote: > > Why? $stdout.close should flush the filehandle. At least, in every > > other programming language I've ever used, closing a filehandle > > flushes its output. I cannot see any good reason why any filehandle, > > once closed, should have any I/O associated with it. > > i think this is because sync is false for stdout, stderr etc. eg. the close > is a *request* to close and flush, but the os may defer the flush. that is, > unless sync were true for all the closed handles... Yes, but the point is that close() should flush the filehandle from Ruby's perspective. If the OS wants to delay its flush, that's fine, it's allowed, but Ruby should not be trying to do a flush (or, indeed, *any* I/O on any filehandle, be it $stdout or $myfilehandle) after calling close() on it. I've filed a bug on ruby-lang.org about this, hopefully someone can take a look at it. In the meantime, I've managed to work around it. -=Eric -- Come to think of it, there are already a million monkeys on a million typewriters, and Usenet is NOTHING like Shakespeare. -- Blair Houghton