Last updated at 3:48 pm UTC on 18 September 2017
subclass of StandardFileStream
Class comment Squeak 4.6
The central class to access the external file. The interface of this object is similar to good old StandardFileStream, but internally it asks the converter, which is a sub-instance of TextConverter, and do the text conversion.
It also combined the good old CrLfFileStream.
now returns an instance of MultiByteFileStream.
There are several pitfalls:
- You always have to be careful about the binary/text distinction. In #text mode, it usually interpret the bytes.
- A few file pointer operations treat the file as uninterpreted byte no matter what. This means that if you use 'fileStream skip: -1', 'fileStream position: x', etc. in #text mode, the file position can be in the middle of multi byte character. If you want to implement some function similar to #peek for example, call the saveStateOf: and restoreStateOf: methods to be able to get back to the original state.
- #lineEndConvention: and #wantsLineEndConversion: (and #binary) can cause some puzzling situation because the inst var lineEndConvention and wantsLineEndConversion are mutated. If you have any suggestions to clean up the protocol, please let me know.
A an instance of MultiByteFileStream is returned when asking for the creation of a FileStream. This is done when asking FileDirectory for a file.