[Vm-dev] Passed: OpenSmalltalk/opensmalltalk-vm#1261 (Cog - 3421494)

Travis CI builds at travis-ci.org
Thu Apr 5 16:58:35 UTC 2018


Build Update for OpenSmalltalk/opensmalltalk-vm
-------------------------------------

Build: #1261
Status: Passed

Duration: 2 hours, 31 minutes, and 30 seconds
Commit: 3421494 (Cog)
Author: akgrant43
Message: Merge pull request #232 from akgrant43/21643-FilePlugin-primitiveFileAtEnd

FilePlugin currently splits files in to two groups: 

1) Stdio streams and
2) everything else.

To test for the end of file, FilePlugin>>primitiveFileAtEnd:

1) Uses feof() for stdio streams.
2) Compares the current position to the file size for everything else.

This returns the expected results for regular files, but fails for
non-regular files, e.g.:

```
(FileSystem / 'dev' / 'urandom') binaryReadStream next: 8.
'/proc/cpuinfo' asFileReference contents
```

both return empty collections.

Modify sqFileAtEnd() (FilePlugin>>primitiveFileAtEnd) so that #atEnd
returns true when the last character has been read.

Both Squeak and Pharo expect that #atEnd can be used to control
iteration over a stream, answering true as soon as the last character
has been read, and importantly not requiring #next values to be tested
for an end-of-stream.

Previously, stdio streams just used feof(), which requires reading past
the end of the stream, and so required the value returned by #next to be
tested for nil.  This causes problems with streams over other
collections where nil is a valid value.

sqFileAtEnd() would also fail to return the correct value for other
files such as kernel virtual files, e.g. /proc/cpuinfo, and devices like
/dev/urandom, because they have a reported file size of 0.

This change also takes a step towards removing the special handling of
stdio files on Unix, significantly simplifying the code base.

This change doesn't break any existing code that uses #next == nil to
test for end-of-stream.

View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/0ce1378d23d0...3421494b43af

View the full build log and details: https://travis-ci.org/OpenSmalltalk/opensmalltalk-vm/builds/362655556?utm_source=email&utm_medium=notification

--

You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications







This email was sent to vm-dev at lists.squeakfoundation.org (mailto:vm-dev at lists.squeakfoundation.org)
unsubscribe from this list (http://clicks.travis-ci.com/track/unsub.php?u=14313403&id=37758087c4dc45c9be655a6c8d8e6363.bhaFHCS7PNgn8KLhhAIsZkVxKmM%3D&r=https%3A%2F%2Fmandrillapp.com%2Funsub%3Fmd_email%3Dvm-dev%2540lists.squeakfoundation.org)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180405/94221882/attachment-0001.html>


More information about the Vm-dev mailing list