-
Notifications
You must be signed in to change notification settings - Fork 33
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
How to access files from the binary #79
Comments
Are you sure you are providing the WASI environment with a file descriptor (capability) to the directory? See e.g. Lines 211 to 214 in 2e9c86f
Note that paths are assumed to be WASI paths, which are Unix/POSIX paths (e.g w2c2's WASI implementation automatically translates Unix paths to the native format ( Lines 313 to 333 in 2e9c86f
What compiler are you using, DJGPP? |
Yes, DJGPP, and i think i have fixed it, my solution also means you do not need to write out the full path. #ifdef __MSDOS__
if (!wasiFileDescriptorAdd(-1, "C:\\", NULL)) {
fprintf(stderr, "failed to add preopen\n");
return 1;
}
#endif
if (!wasiFileDescriptorAdd(-2, ".", NULL)) {
fprintf(stderr, "failed to add preopen\n");
return 1;
}
if (!wasiFileDescriptorAdd(-3, "/", NULL)) {
fprintf(stderr, "failed to add preopen\n");
return 1;
} |
Not really related, but how would I compile for windows 2000? |
How do you run on drive D or later with your fix? |
I dont know, haven't tried. if (!wasiFileDescriptorAdd(-1, "A:\\", NULL)) {
fprintf(stderr, "failed to add A: preopen\n");
}
if (!wasiFileDescriptorAdd(-1, "B:\\", NULL)) {
fprintf(stderr, "failed to add B: preopen\n");
}
if (!wasiFileDescriptorAdd(-1, "C:\\", NULL)) {
fprintf(stderr, "failed to add C: preopen\n");
}
if (!wasiFileDescriptorAdd(-1, "D:\\", NULL)) {
fprintf(stderr, "failed to add D: preopen\n");
} etc |
I have built RustPython for DOS, https://github.com/coolcoder613eb/RustPython
And I want to know how make the binary accept files from the command line.
right now it says:
[ERROR rustpython_vm::vm::compile] Failed reading file 'PYBASIC.PY': No such file or directory (os error 44)
The text was updated successfully, but these errors were encountered: