Paul Lutus <nospam / nosite.zzz> writes:

> 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. There never
> should have been two standard line endings (actually three if you
> include the Mac), and there never should have been two path
> delimiters either, both of which cause endless headaches for
> cross-platform coders.
>
> 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).
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).

This legacy is from long before POSIX, in fact, from long before C.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum