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

Error: EISDIR: illegal operation on a directory, fstat #18

Open
jtenner opened this issue Jul 16, 2019 · 1 comment · May be fixed by #19
Open

Error: EISDIR: illegal operation on a directory, fstat #18

jtenner opened this issue Jul 16, 2019 · 1 comment · May be fixed by #19

Comments

@jtenner
Copy link

jtenner commented Jul 16, 2019

Hello! Great work on this project by the way.

In reference to #17 where the writes to stdout and stderr were returning 31.

Looks like

const stat = (wasi, fd) => {
  ...
  const stats = fs.fstatSync(entry.real);
  ...
};

Seems to be the trouble on windows. :)

When the file descriptor is 0, 1 or 2, it looks like an error code EISDIR is thrown because it's not an actual file descriptor on windows.

Perhaps there is a good way this can be fixed? I could help submit a pull request.

@devsnek
Copy link
Owner

devsnek commented Jul 16, 2019

If someone on windows wants to fix this I will gladly accept a PR.

Alternatively, a better solution might be to change fds 0, 1, and 2 to be streams, which would allow overriding them in the wasi constructor. This would also mean the defaults can be process.stdin and such so we wouldn't need to worry about platform specifics.

@jtenner jtenner linked a pull request Jul 16, 2019 that will close this issue
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 a pull request may close this issue.

2 participants