
I don't see that hGetPS should be consistent with hGetLine. If hGetLine returns and empty string, you assume the file has two newlines in a row, while if hGetPS returns an empty string, since you asked for 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 zero. 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. Cheers, Simon
participants (1)
-
Simon Marlow