April 12, 2018
6:31 a.m.
On Wednesday 11 April 2018 10:38 PM, Alistair Grant wrote:
StandardFileStream>>readInto:startingAt:count: assumes that primitiveFileRead will always attempt to read count bytes, but it actually only attempts to read 1.
StandardFileStream>>#basicNext uses position < readLimit ifFalse: and does not check if the primRead returns < 0. Instead it should call whileFalse: and check if primRead returns <= 0 to check for EOF or error. #primRead:... returns an error if the primitive fails and the file is closed. It should instead check for EOF or error and then return -1, otherwise it should return 0 (Data not ready?). Raise an error only if the underlying primitive fails for non-EOF cases. Regards .. Subbu