Am 12.12.2020 um 22:13 schrieb Allin Cottrell:
On Sat, 12 Dec 2020, Sven Schreiber wrote:
>
> The file got 5 new characters, and closer inspection shows this content:
> noCRCRLFsleepCRCRLFtillCRCRLFBrooklynCRLF
>
> This time there's no email involved, just gretl I think!
This whole business is an annoyance and stumbling-block for coders
almost as severe as Microsoft's persistence with an unholy mixture of
8-bit "system codepage" and UTF-16. They persist in using two bytes to
indicate what everyone else indicates in one byte (start a new line),
because in the stone age this required two operations of a teletype
machine: crank the paper up a line, and return the print-head to the left.
Getting this "right" in a cross-platform program is a horror-show. That
said, it might now be better in current git and snapshot.
Keyword: "binary mode" or "b" when calling the C library function
fopen() for reading or writing. It does nothing except when you're
handling text files on Windows. But when should you use it, and when not?
I feel your pain, Allin! Indeed I remember issues like that also in
Python where it was never quite clear to me what the file write mode was
supposed to mean in detail...
Thanks for the fix,
Sven