-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limited compatibility with FileStream #13
Comments
No standard specifies that
(pp. 196, 197, July 1985 edition) But since "reporting an error" is a bit vague: 1. you can change the method here to return nil, 2. no code that wishes to be portable should actually rely on this behavior... If you want to read single bytes, why not use a binary stream? If you want characters, you must think about the encoding. When in doubt, use CP1252TextConverter or ISO88591TextConverter/Latin1TextConverter. Looking at MultiByteFileStream>>basicNext, I suppose basicBack should make sure that the position does not go below zero. I have already given @MariusDoe my blessing to let the FS streams inherit from Stream, copy further methods from there, or whatever makes sense to address the Stream behavior that is "missing". |
Oh, fair point. Though even an exact source code search for
Thank you! I'm actually doing both after each other: First a byte, then a string, then a number, then a character ... In default Squeak, I just can send
+1
Ok, thanks for the update! |
We noticed several compatibility issues that severely limit the applicability of FS in Squeak:
Different behavior of
next
: In Squeak's Files package, it answersnil
when at the end of the stream. FS raises an error.e.g., this makes it incompatible with Json:
No single-byte file stream option: In the Files package,
StandardFileStream
reads files byte per byte as opposed toMultiByteFileStream
which uses a converter. AllFSStream
s require the use of a converter. Since there seems not to be something as a null converter (?), this makes it impossible to read files that were written usingStandardFileStream
.basicBack
is missing onFSReadStream
which is sent fromUTF8TextConverter
in response to#skip:
. E.g.:Does this implementation make sense?
No support for data get/put protocol which limits usage for Sounds and others. See hpi-swa/Squot@4b35071 for more details. /cc @MariusDoe
In general, the question remains how much compatibility is desired ... but I would like it ... :-)
The text was updated successfully, but these errors were encountered: