Paul Lutus wrote:
> ciapecki wrote:
> 
> / ...
> 
>> I was that stupid and forgot to open the writable file as binary "wb"
>> (before I had "w" only)
> 
> Don't kick yourself too hard, the error lies with Microsoft trying to golf
> its way out of a thicket of its own making.

Not fair to MS, in this case; they simply copied DR, who had copied DEC. 
(And the CRLF ending is, arguably, the most faithful to the ASCII 
design.) It was only as of MS-DOS 2.0 that MS started the long uphill 
road to kinda-sorta Unix compatibility, and by then it was too late to 
change, just as it was too late to use "/" as a directory separator.

(To an IBM mainframe programmer, after all, all three line-ending 
methods look stupid. In mainframes, files are made up discrete records 
-- like rows in an SQL database -- and aren't terminated by any byte 
value at all.)

-- 
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
   -- Charles Williams.  "Taliessin through Logres: Prelude"