Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Emsdk 3.1.59
Use case:
I have a c++ program compile to WASM via emscripten that expects the filesystem to be setup before main() function is run. It is a requirement that any files generated by the program are available for the next time it is run.
Previously I was able to make good use of BrowserFS to persist changes. That project has now been deprecated (and in my case a regression between emscripten 2.0.31 and 2.032 caused different file behaviour that I was unable to isolate/solve).
I suspect that the flow I followed is similar to a lot of other projects:
The file system construction currently happens in a function referenced as Module.preRun: [initialSetup]
where:
After which the main method is automatically called and the filesystem would be available to the program.
As an added bonus it was easy enough to use the FS api methods like FS.readFile(filePath, { encoding: 'binary' }) from javascript to extract files.
I am looking at some of the recent references to WASMFS and particularly OPFS.
Like: #18112 (comment)
Unfortunately I'm having difficulty translating the hints into the above flow.
Would be grateful for an outline on how to achieve this. The more complete the example working code the better.
Beta Was this translation helpful? Give feedback.
All reactions