[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] FilePlugin>>primitiveFileAtEnd for non-regular files (#232)

akgrant43 notifications at github.com
Sun Apr 1 15:34:35 UTC 2018


Hi Nicolas,

> So, it shows that we are not on the right track.
> The right way to do it on Unix is to try to read and check if atEnd in
> post-condition rather than trying to test atEnd in pre-condition.

But that is exactly what this PR is about - it provides the ability for a post-condition check to be performed.

> This is exactly as suggested by Levente.
> Or even better, get some end-of-file error condition directly in response
> to read primitive, and handle that gracefully at image side.

The correct usage, as you say above, is to read until there is no more data, and then check to see if the end of file has been reached.  Without this (modified) primitive there's no way to perform that check.

We could change the image to handle no-more-data and end-of-file differently, but it would still require the check to be made, and I wouldn't combine the read and eof checks in to one primitive.

> IMO primitiveFileAtEnd should rather be deprecated.

Based on my understanding, I disagree.  Please let me know if I'm missing something.

Cheers,
Alistair


-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/232#issuecomment-377794834
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180401/d1b6e132/attachment.html>


More information about the Vm-dev mailing list