WebAssembly/wasi-libc

A way to redirect stdout/stderr to another file _and then back_ would be nice

whitequark opened this issue · 2 comments

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.

Actually, it looks like there is __wasi_fd_renumber and it is a part of the public API.

Yeah, that works.