You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using WAMR_BUILD_LIBC_WASI and basic printf and stuff works.
I am making a game-engine that loads a zip file for all assets. It has a wasm file in it, that is the user's code, which I can read & run fine. I use physfs to make the host functions (load image, etc) work correctly, but I would like to expose this to WASI (so users can use regular WASI functions to read files in zip, directly.)
I don't see anything for preloading files, other than the directory-mounting stuff, and I really don't want to extract the files before running them.
In other hosts (like with emscripten on web, or with other web wasi-shims) I would preload the files (mapping fd numbers to file contents) or hook up the wasi_snapshot_preview1 functions directly to accessing the files. I can't figure out how to do it in WAMR. Ideally, I'd like to mostly use the existing/working LIBC_WASI and just hook into the part like "when the user tries to access a file, give them this from physfs instead." Is there a way to preload files, or even better access them directly on the fly, without having to extract them all?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using WAMR_BUILD_LIBC_WASI and basic printf and stuff works.
I am making a game-engine that loads a zip file for all assets. It has a wasm file in it, that is the user's code, which I can read & run fine. I use physfs to make the host functions (load image, etc) work correctly, but I would like to expose this to WASI (so users can use regular WASI functions to read files in zip, directly.)
I don't see anything for preloading files, other than the directory-mounting stuff, and I really don't want to extract the files before running them.
In other hosts (like with emscripten on web, or with other web wasi-shims) I would preload the files (mapping fd numbers to file contents) or hook up the
wasi_snapshot_preview1
functions directly to accessing the files. I can't figure out how to do it in WAMR. Ideally, I'd like to mostly use the existing/working LIBC_WASI and just hook into the part like "when the user tries to access a file, give them this from physfs instead." Is there a way to preload files, or even better access them directly on the fly, without having to extract them all?My engine is here.
Beta Was this translation helpful? Give feedback.
All reactions