Basic question about stderr
Mike Parker via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat May 21 19:48:10 PDT 2016
On Saturday, 21 May 2016 at 22:11:30 UTC, chaseratx wrote:
> On Saturday, 21 May 2016 at 22:08:15 UTC, Era Scarecrow wrote:
>> On Saturday, 21 May 2016 at 21:54:43 UTC, Era Scarecrow wrote:
>>> On Saturday, 21 May 2016 at 21:47:20 UTC, chaseratx wrote:
>>>> Thanks Era, but I am not trying to fix the range error.
>>>> That was put there intentionally to create stderr output.
>>
>>> I wonder, this sounds like a TLS (Thread Local Storage)
>>> issue where the local thread's stderr was updated but the
>>> global (shared?) one wasn't.
>>
>> Well found a quick solution. gotta close the original handle
>> first! :)
>>
>> stderr.close();
>> stderr.open("error.log", "a");
>> stdout.open("output.log", "a");
>
> Oh, excellent! I will try that now. :)
This should also work:
stderr = File("error.log", "a");
stdout = File("output.log", "a");
More information about the Digitalmars-d-learn
mailing list