On Friday 30 July 2004 10:49 am, lex@cc.gatech.edu wrote:
Ned Konz ned@bike-nomad.com wrote:
All previously-existing code expected that text streams would return Characters that had a 1:1 mapping to the bytes in the file.
Actually, there are CrLfFileStream and TextFile, both of which do not necessarily give 1:1 mappings. Those of us that use one of these classes think your discussions about CR versus LF are amusing.
Those of you who do not use these classes think our complaints about the incorrect 1:1 assumption are amusing.
Anyway, the point is that those of us who sufered through using CrLfFileStream in a 1:1-assuming world, have already managed to get some things in Squeak fixed over time.
You may recall that I was one of those who did suffer through using CrLfFileStream for a while and submitted fixes for it. This was in 2.9a, 3.4, and possibly later as well.
One of my sets of fixes, in fact, introduced a distinction between opening text streams and opening raw streams: by adding new stream creation methods that paralleled the existing ones, we could be specific about what we wanted.
Something like (I don't recall the names):
oldFileNamed: 'whatever' => text file, whatever the defaults are (encoding, translation ...)
oldRawFileNamed: 'whatever' => 1 character per byte, no translation
Also, I can tell you that it's not too bad to just switch over like this. It's easy to fix the individual broken cases; it is just frustrating that the upstream developers frequently don't really care.
Do you know of any CrLfFileStream related fixes that we need to apply?