<p>Hi Nicolas,</p>
<blockquote>
<p>So, it shows that we are not on the right track.<br>
The right way to do it on Unix is to try to read and check if atEnd in<br>
post-condition rather than trying to test atEnd in pre-condition.</p>
</blockquote>
<p>But that is exactly what this PR is about - it provides the ability for a post-condition check to be performed.</p>
<blockquote>
<p>This is exactly as suggested by Levente.<br>
Or even better, get some end-of-file error condition directly in response<br>
to read primitive, and handle that gracefully at image side.</p>
</blockquote>
<p>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.</p>
<p>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.</p>
<blockquote>
<p>IMO primitiveFileAtEnd should rather be deprecated.</p>
</blockquote>
<p>Based on my understanding, I disagree.  Please let me know if I'm missing something.</p>
<p>Cheers,<br>
Alistair</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/232#issuecomment-377794834">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW5X4MsSeI7Ho0bvOOfBXFn8HtRaaks5tkPOKgaJpZM4S6rMa">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyW3_QI3wTjhr1XcAwk5VoOHxPU-Zeks5tkPOKgaJpZM4S6rMa.gif" height="1" width="1" alt="" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/232#issuecomment-377794834"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@akgrant43 in #232: Hi Nicolas,\r\n\r\n\u003e So, it shows that we are not on the right track.\r\n\u003e The right way to do it on Unix is to try to read and check if atEnd in\r\n\u003e post-condition rather than trying to test atEnd in pre-condition.\r\n\r\nBut that is exactly what this PR is about - it provides the ability for a post-condition check to be performed.\r\n\r\n\u003e This is exactly as suggested by Levente.\r\n\u003e Or even better, get some end-of-file error condition directly in response\r\n\u003e to read primitive, and handle that gracefully at image side.\r\n\r\nThe 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.\r\n\r\nWe 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.\r\n\r\n\u003e IMO primitiveFileAtEnd should rather be deprecated.\r\n\r\nBased on my understanding, I disagree.  Please let me know if I'm missing something.\r\n\r\nCheers,\r\nAlistair\r\n"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/232#issuecomment-377794834"}}}</script>