bug in hGetPS?

Simon Marlow simonmar@microsoft.com
Mon, 28 Apr 2003 13:20:36 +0100

> I don't see that hGetPS should be consistent with hGetLine. =20
> If hGetLine
> returns and empty string, you assume the file has two=20
> newlines in a row,
> while if hGetPS returns an empty string, since you asked for=20
> a given number
> of chars, you know that you've reached the end of the file.

I mean that hGetPS is inconsistent with hGetLine in the sense that
hGetPS never throws the EOF exception.  The consistent interpretation
would be for hGetPS to throw an EOF exception if the Handle is
positioned at the end of the file, unless the requested byte count is

It wouldn't make sense to have hGetLine behave in the same way as hGetPS
does now, because as you say there would be two possible meanings for an
empty string returned.