FileStream concreteStream MultiByteFileStream

Stan Heckman nrooldarta at whoudsoofu.mailexpire.com
Tue Mar 15 02:58:02 UTC 2005


On Mon, Mar 14, 2005 at 01:58:06PM -0800, Yoshiki Ohshima wrote:
>   What (or in which way) do you mean by "wrong"?  The text has lf and
> it doesn't show up nicely in the FileList?

Yes, that is what I mean.

>   * First, update to 6599.

Done.

>   * File in the attached change set.

Done

>   * Whenever you think you're looking at a text file, choose 'view as
>     encoded text' item from the bottom pane of FileList.

This is very nice. Thank you very much for this.

At present, for my own purposes, CrLfFilestream has two advantages over this
solution. First, with CrLfFilestream, when I edit the file in the
filelist, the line terminators inserted are consistent with the other
terminators in the file. Second, CrLfFilestream makes the file appear
immediately with line breaks where expected, while the encoded text
solution requires some clicking in the bottom pane before the file is 
formatted.

Of course, I understand that CrLfFilestream has one very important
disadvantage; it cannot display multibyte characters. 

I think the cause of MultiByteFileStream not writing at all is the line
  brevityState == #fullFile ifTrue:
    
If that is changed to, for example,
  (#(#fullFile #'iso-8859-2') includes: brevityState) ifTrue:
then MultiByteFileStreams can be written from the FileList.

I think the cause of MultiByteFileStreams writing with CR instead of
platform line terminators is that detectLineEndConvention returns LF
for CrLfFileStream and returns nil for MultiByteFileStream.

  CrLfFileStream new detectLineEndConvention (print it yields #lf)
  MultiByteFileStream new detectLineEndConvention (print it yields #nil)

Thanks again for the change set.

-- 
Stan



More information about the Squeak-dev mailing list