Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
stdout cannot be reassigned on some systems #12939
var f: File stdout = f
On Ubuntu and OSX, this works fine. In my code, I am backing up stdout and restoring it later.
However, on Windows I see:
On the Nim playground, I see:
stdout is a var so it should be writable in theory.
I am using reopen for Windows but cannot recover stdout when I want it back later on in my program.
Any reason why this shouldn't work consistently across OS?
stdout cannot be reassigned on some systems. glibc is okay with it but it fails on Windows and musl based systems. This isn't a Nim issue.