disabling and enabling console output

Vladimir Panteleev thecybershadow.lists at gmail.com
Thu May 16 17:49:05 UTC 2019


On Thursday, 16 May 2019 at 17:42:17 UTC, Alex wrote:
> I'm not sure if they are failing to block or if they are 
> blocking what is being opened(and not the original console). 
> That is, do I need to not open and simply close stdout?

Yes, I see. It won't work because the two libraries are using 
different C standard libraries, so, SDLImage can't see that the 
FD was dup'd, and the DM C library most likely doesn't also 
dup/close the Windows handle.

I'm not sure how to do this on Windows, then; maybe someone with 
more experience would know. Windows has DuplicateHandle, but no 
equivalent for dup2 that I know of, which would be needed to 
restore stdin using this method.



More information about the Digitalmars-d-learn mailing list