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

Nicolas Cellier notifications at github.com
Sun Apr 1 19:26:56 UTC 2018


Hi Alistair,
OK, I see your point, my proposal would work for /dev/random but maybe not all possible kind of stream
But then primitiveFileAtEnd is trying to be too smart:
- being able to test atEnd in pre-condition for regular files
- being able to test atEnd in post-condition for the rest of the world (pipe socket special devices etc...).
It's kind of brainfuck. I say we should simplify and keep only one, post-condition with a simple feof and leave smartness at image side.
What if we add

    primitiveEncounteredEndOfFile
        "Answer true if the end of file was encountered at last read operation".

And leave current primitive only for backward compatibility with deprecation warning in the comment?


-- 
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-377810556
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180401/dd33e85c/attachment.html>


More information about the Vm-dev mailing list