[SAOC 2024] - Leverage dmd as a library in D-Scanner in order to extend its functionality - Weekly Update 7
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Mon Nov 11 02:41:36 UTC 2024
On 11/11/2024 12:04 PM, Vladiwostok wrote:
> On Monday, 4 November 2024 at 08:53:21 UTC, Richard (Rikki) Andrew
> Cattermole wrote:
>> Something about this isn't sounding right.
>>
>> https://github.com/dlang/phobos/blob/master/std/file.d#L861
>>
>> There is no handling of new lines, in fact it doesn't even know that
>> it is textual.
>
> `rawWrite` fixed the issue, no additional carriage returns are added in
> the test file:
> https://github.com/Dlang-UPB/D-scanner/
> commit/8db5a658134994cd1f388ca4b5613a5bb24870a2
>
> Any idea why?
Not a behavior of WinAPI, its the libc doing it:
https://github.com/dlang/phobos/blob/master/std/stdio.d#L2976C57-L2976C64
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/setmode?view=msvc-170#remarks
Took me a bit to find.
More information about the Digitalmars-d
mailing list