On Tue, Dec 22, 2009 at 04:29:27PM -0800, Michael G Schwern wrote:

> A little experimentation with a small disk image shows that close() will 
> error if there's no disk left.  No need to check every print.  And a 
> close() wrapper is trivial.  It does mean there needs to be a close() for 
> every open() which is annoying but less so.

Yes, this is the correct way to handle this.

It is also something that should be done in any code you care about.
When you open a filehandle you should explicitly close it and make sure
that the close succeeded.  Or understand why you are not doing that.

I agree that since autodie (I still hate that name) handles half of this
is would be very nice if it could somehow be persuaded to handle the
other half.

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net

Reply via email to