FileStream encoding (Re: New SqueakMap)

Yoshiki Ohshima yoshiki at squeakland.org
Thu Apr 13 15:43:43 UTC 2006


  Martin,

> as Andreas noted you indeed seem to think that FileStream is or should 
> be a text file stream.

  It is not that simple.

  * Today, it is both #text and #binary in Squeak, anyway.
  * If we talk about its default, Squeak's default has been text and
    code built around assumes that.  (So, in a sense, it
    is a text file stream by default.)
  * Strictly speaking, it is not logically correct to open a .gif file
    as a text stream with any encoding conversion, including no-convertion.
  * (The Stream chops off the malformed data is different issue.)
  * For mid- and longer term, separate the responsibility is a good
    thing.  We'll have two or more things, perhaps one is a wrapper
    stream of another so the question whether "it" is what or not will
    (hopefully) become an unissue.

> Well, I think otherwise. There are myriads of 
> other structured data types than text and that means that raw byte 
> handling is different from all of them, because it is their base.

  I'm not disagreeing with that.

> The name FileStream does not specify the contents of the file and thus 
> it is natural to think of it as the underlying and unspecified byte-handler.

  I'm not entirely sure about your suggestion.  Are you suggesting:

  1 to change the default soon?
  2 to change it to #binary to be a unspecified byte-handler?
  3 to change it to #text and no-conversion, as Göran?
  4 or, just stating it should be so?

I agree with 4 in a sense that the thing at the bottom is bytes.  For
3, not so sure. For 1 and 2, I would disagree.

-- Yoshiki



More information about the Squeak-dev mailing list