A way to redirect stdout/stderr to another file _and then back_ would be nice
whitequark opened this issue · 2 comments
whitequark commented
wasi-libc does not have dup2
, stdout
/stderr
are marked const
, there is no fdopen
equivalent that uses an existing file, and /dev/stdout
//dev/stderr
are not a thing.
whitequark commented
Actually, it looks like there is __wasi_fd_renumber
and it is a part of the public API.
whitequark commented
Yeah, that works.