Bug or feature in StandardFileStream
David T. Lewis
lewis at mail.msen.com
Sun Feb 12 15:02:26 UTC 2006
On Sun, Feb 12, 2006 at 03:38:34PM +0100, nicolas cellier wrote:
> Le Dimanche 12 Février 2006 15:19, David T. Lewis a écrit :
> >
> > It's a feature. It just means that you can set the file position beyond
> > end of file, at which point it is no longer "atEnd". You can use
> > #setToEnd to position the file pointer to the actual end of file.
>
> Maybe it's a usefull feature for files opened for writing, I don't know.
>
> But Martin had its file opened readOnly, in which case such a feature makes no
> sense.
>
> What would file next will answer? an infinite collection of zeros like a null
> stream ?
It answers nil.
>
> Everybody would prefer getting an Exception rather than this strange behavior
> i guess.
Agreed.
Note the squeak file system code was written many years before the
introduction of exceptions, and there is wide agreement that it is
due for some rework. There is a team forming up to look into this:
<http://www.squeak.org/Community/Teams/>
<http://lists.squeakfoundation.org/pipermail/squeak-dev/2006-January/099050.html>
Dave
More information about the Squeak-dev
mailing list
|