On Saturday, 16 July 2022 at 20:08:38 UTC, Adam D Ruppe wrote:
The default here is write in text mode, change the "w" to "wb"
and it won't molest your line endings any more.
Thank you, that worked.
This raises 3 questions for me.
1. Are there any nasty pitfalls with this change that might
On Saturday, 16 July 2022 at 19:54:08 UTC, HuskyNator wrote:
File("test.txt", "w").write(a);
The default here is write in text mode, change the "w" to "wb"
and it won't molest your line endings any more.
While trying to figure out why my reading from & write back to
file kept increasing the size of my entries, I figured out
File.write always introduces a \r character before any \n
characters, even if they are already preceded by one.
Is this intentional behaviour or an oversight?
Example:
On Saturday, 16 July 2022 at 12:40:09 UTC, Paul Backus wrote:
On Saturday, 16 July 2022 at 08:40:10 UTC, D Lark wrote:
On Wednesday, 13 July 2022 at 01:40:43 UTC, Paul Backus wrote:
On Wednesday, 13 July 2022 at 01:23:35 UTC, D Lark wrote:
[...]
Yes, it should behave the way you expect. The
On Saturday, 16 July 2022 at 08:40:10 UTC, D Lark wrote:
On Wednesday, 13 July 2022 at 01:40:43 UTC, Paul Backus wrote:
On Wednesday, 13 July 2022 at 01:23:35 UTC, D Lark wrote:
First, please can someone clarify if the behaviour I expect
in the last line is consistent with the intention of the
On Saturday, 16 July 2022 at 08:40:10 UTC, D Lark wrote:
On Wednesday, 13 July 2022 at 01:40:43 UTC, Paul Backus wrote:
On Wednesday, 13 July 2022 at 01:23:35 UTC, D Lark wrote:
First, please can someone clarify if the behaviour I expect
in the last line is consistent with the intention of the
On Wednesday, 13 July 2022 at 01:40:43 UTC, Paul Backus wrote:
On Wednesday, 13 July 2022 at 01:23:35 UTC, D Lark wrote:
First, please can someone clarify if the behaviour I expect in
the last line is consistent with the intention of the library?
Yes, it should behave the way you expect. The