disabling and enabling console output
Vladimir Panteleev
thecybershadow.lists at gmail.com
Thu May 16 17:07:39 UTC 2019
On Thursday, 16 May 2019 at 17:05:01 UTC, Alex wrote:
>> One thing you could try is going one level lower, and using
>> dup() to save the stream to another fd, close() to close the
>> stdout one, and dup2() to restore the saved fd over the stdout
>> one.
>
> Unfortunately D doesn't seem to have dup, dup2.
They are in the C library. Looks like Druntime has D declarations
only for Posix:
https://github.com/cybershadow/druntime/blob/issue19433/src/core/sys/posix/unistd.d#L51-L52
You can just copy those.
More information about the Digitalmars-d-learn
mailing list