From: Ned Konz Date: 2002-07-09T07:42:22+09:00 Subject: Re: How to determine EOF with sysread? On Monday 08 July 2002 01:34 pm, Jim Freeze wrote: > You have a point, but everyone that provided code to answer my > question assumed there was no errors in reading. In other words, if > we use the exception to catch an EOF, we have to be able to > distinquish it from a 'real' error. So, if the file is 100 bytes, > and it only reads fifty, I would like to know about it. > > Seems I would have to add some code to sum the bytes read and > re-throw if the exception is caught before the end of the file is > reached. Depends on whether you know how big it needs to be. But if you just want to catch read errors, just catch SystemError somewhere (possibly higher). No need to re-throw at this level. -- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE