[Scummvm-devel] eos()
Marcus Comstedt
marcus at mc.pp.se
Thu Apr 28 09:32:25 CEST 2005
Max Horn <max at quendi.de> writes:
> No, it was intended for the common base class. An EOF can occur for a
> write stream, too -- e.g. if the disk is full or any other I/O error
> occurred (compare with feof).
Well, I disagree:
* If a write error such as disk full has prevented the stream from
writing something, this can (and should) be reported with
ioFailed(), so there is no need for a second function to report
error conditions.
* Unless there is a seek function (which there isn't), a write stream
is always at the end of the stream (such as it is at the moment).
Thus the function name is inappropriate for the (redundant)
functionality you suggest.
Comparisons with feof() should be avoided, since it's not a very good
function. For example, even if you are at the end of a file opened in
read-mode, feof() will not return true until you have actually
attempted (and failed) to read past the end. I don't expect you're
proposing such broken semantics for eos()?
// Marcus
More information about the Scummvm-devel
mailing list