Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add stdout/stderr Fd class #54

Conversation

kateinoigakukun
Copy link
Contributor

stdout/stderr should provide proper rights and filetype because wasi-libc still respects them in fcntl.

@kateinoigakukun kateinoigakukun force-pushed the pr-ad4c2dc52dd84e8b9240a7ce442ec601f9441fe6 branch from fe1e460 to b31fba0 Compare December 5, 2023 16:32
@bjorn3
Copy link
Owner

bjorn3 commented Dec 5, 2023

I intentionally didn't add stdin and stdout types because there is no stdin/stdout in the browser, so one way or another the user of browser_wasi_shim will have to make their own class to read/write from their own location. For example the rustc.html example uses a class that interacts with a terminal emulated by xterm.js.

@kateinoigakukun
Copy link
Contributor Author

kateinoigakukun commented Dec 5, 2023

Okay, sounds reasonable to me. Then does it make sense to export wasi_defs.js from this package to allow users to implement Fd interfaces using some classes in the module (e.g. Filestat, Fdstat)?

@bjorn3
Copy link
Owner

bjorn3 commented Dec 5, 2023

Yeah, exposing those types should be fine.

@kateinoigakukun
Copy link
Contributor Author

Closing in favor of exposing types in another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants