David Vallner wrote:

/ ...

>>> The reason these variations exist is so someone can say, "my
>>> software is different, unique, patentable, now you have to pay me
>>> for it." Even if the differences convey no benefit to the users.
>> 
>> No, the reason is that CP/M had no tty concept, and consequently no
>> automatic LF->CRLF translation (and CRLF is required on printers).

That was the original reason, yes, but it is hard to justify it this far
down the road, with what are ostensibly sophisticated operating systems,
unless the idea is to enshrine a handful of bad choices forever.

>> Also forward slashes were used in CP/M as option lead-ins (CP/M, not
>> having named directories, did not need to use forwards slashes for
>> those).

Actually, yes, I remember this also. There were no hierarchical directory
trees at first (at least not in CP/M), so the ambiguity between command
delimiters and path delimiters didn't come up until it was too late to
settle on something more universal.

> Hrm, and I also recall once knowing about why the different text /
> binary file handling was around. Something to do with some DOS
> programming environment and efficient (by a measure that could only have
> been important enough to warrant a design wart on the hardware from
> then) line-oriented text processing.

I recall the line ending management issue came up because C (and, later,
C++) used Unix line endings internally, therefore they converted any text
files on the fly as they were read or written. But, because some files were
binary, not text, it became necessary to tell the file reader/writer
routines whether or not this behavior was desired.

> I don't think there's any distinction between the file modes on the OS
> level anymore, but programming language runtimes interpret the absence
> of the 'b' flag as "translate newlines" to only have to internally
> support one convention and avoid having to have every text manipulation
> routine handle the difference gracefully.

But only on Windows. The presence or absence of the "b" flag has no effect
on other platforms, which don't convert line endings. Except possibly the
Mac -- I don't know how Macintoshes deal with this, IIRC they have \r as a
line ending.

> The blurb about preserving the idiosyncracies as a business strategy is
> hilarious. Also patent nonsense and FUD ;)

One can't help thinking this is the real motive behind a lot of this stuff.

-- 
Paul Lutus
http://www.arachnoid.com