Re: File.write introduces \r regardless of presence

2022-07-16 Thread HuskyNator via Digitalmars-d-learn
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

Re: File.write introduces \r regardless of presence

2022-07-16 Thread Adam D Ruppe via Digitalmars-d-learn
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.

File.write introduces \r regardless of presence

2022-07-16 Thread HuskyNator via Digitalmars-d-learn
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:

Re: Why does inputRangeObject fail to derive correctly for RandomAccessInfinite ranges?

2022-07-16 Thread D Lark via Digitalmars-d-learn
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

Re: Why does inputRangeObject fail to derive correctly for RandomAccessInfinite ranges?

2022-07-16 Thread Paul Backus via Digitalmars-d-learn
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

Re: Why does inputRangeObject fail to derive correctly for RandomAccessInfinite ranges?

2022-07-16 Thread D Lark via Digitalmars-d-learn
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

Re: Why does inputRangeObject fail to derive correctly for RandomAccessInfinite ranges?

2022-07-16 Thread D Lark via Digitalmars-d-learn
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