Extending FileList with CrLf

Lex Spoon lex at cc.gatech.edu
Mon Jul 21 17:19:16 UTC 2003


Daniel Vainsencher <danielv at netvision.net.il> wrote:
> [Using CrLf by default]
> I strongly disagree.

Could you please elaborate on your stance?  If we switch over then a
practical problem will be solved: people who don't use CrLfFS write code
that breaks under CrLFFS, and there's no need for it.  Further, most
people who don't use Mac's would like to have the functionality.

Since there are practical advantages, we should only stop due to
practical disadvantages, or to very clear philosophical problems.  Your
philisophical issue are unclear to me, though I will try to respond to
them as best I can.  You mention no practical problems.


> How files are interpreted, at any level, should not
> be a system wide decision made by low level streaming classes. It should
> be an application level decision.

It would be an application decision.  The application states whether
it wants binary or text mode, and it gets what it asks for.  The debate
is about what, exactly, "text" mode should ask for.

As things stand, people keep proposing replacing this or that with an
explicit use of CrLfFileStream.  This shows that it's a commonly
requested behavior in practice.  I claim that every single "text file"
Squeak uses should get this functionality, and thus we may as well make
it the default.  If you care about the exact line end convention that a
file uses, then you are trying to control individual bytes and thus you
aren't really using a "text file" after all.  For example, PDF's are not
text files despite using a lot of ASCII in them.




> IMO, the fact that CrLfStream tries to be quite subtle about what it
> does is a point against as a default, though it might be useful for 
> a specific user or application. The default behavior should be simple 
> and transparent.

Why do you say it is subtle?  It maps CR, LF, and CRLF to CR, if the
file is in text mode.  That's all.

It's simple and it's transparent.  Additionally, it's useful and it's
what people usually want.  These are great things for a default,
so let's make it the default.


Lex



More information about the Squeak-dev mailing list