Can we get rid of non-raw write?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Wed Mar 20 21:44:56 PDT 2013


On Wed, 20 Mar 2013 23:00:18 +0100
"Graham Fawcett" <fawcett at uwindsor.ca> wrote:

> On Wednesday, 20 March 2013 at 21:33:48 UTC, H. S. Teoh wrote:
> > On Wed, Mar 20, 2013 at 10:20:08PM +0100, Graham Fawcett wrote:
> >> On Wednesday, 20 March 2013 at 14:34:21 UTC, Nick Sabalausky 
> >> wrote:
> >> >Since *at least* as far back as XP, Windows has handled "\n" 
> >> >newlines
> >> >perfectly fine. The command line displays them properly, .BAT 
> >> >scripts
> >> >handle them properly, every code editor in existence handles 
> >> >them
> >> >properly. The *only* thing I've found that doesn't is Windows
> >> >Notepad, but really, whoTF uses that anyway?  ....
> >> >
> >> >Can we please get rid of this "text-mode output"? Or at least
> >> >eliminate it as the default?
> >> 
> >> +1. Leave an option in their for "ancient Windows support" if
> >> necessary, but take it out as the default.
> > [...]
> >
> > What about MacOS?
> 
> Is anyone still using MacOS earlier than version 10 (OSX)? Mac OS 
> 9 was discontinued in 2002.
> 

It was more than discontinued, it was more or less obliterated. Even
OSX 10.3 and below are basically unusable anymore (unless you don't
expect to be able to install anything). Probably 10.4, too. \r as a
line ending is long dead. Might be worth supporting *reading* it in
certain cases (old text files can live on for a long time), but
not writing.

> On OSX, there's certainly no problem with Unix line endings. But 
> I guess if we include "ancient Windows support" as an option, 
> then "ancient Mac support" should in be there too.
> 
> But writeln/writefln should emit '\n' as a line terminator, by 
> default, on all platforms. Ancient terminators should be always 
> opt-in, regardless of platform.
> 

Yea, and by "Ancient" it's not as if we're even calling XP ancient.
We're talking circa-Win9x line here. DMD and Phobos don't even try to
support those anyway, and yet that's exactly what "write*" are
essentially catering to.

I know Walter has said in the past that "there are places" where Windows
still expects \r\n, but if even if that's true, such places are rare
and are best handled as special cases as-needed.



More information about the Digitalmars-d mailing list