Another option is to use the JS FS API to access the in-memory filesystem. Here is readFile for example:
https://emscripten.org/docs/api_reference/Filesystem-API.html#FS.readFile You can also traverse the FS data directly, at a lower level. Here is how test_poppler in the test suite gets a file's data, for example: MEMFS.getFileDataAsRegularArray(FS.root.contents['filename-1.ppm']) On Sat, Dec 7, 2019 at 4:41 AM Mehdi Sabwat <[email protected]> wrote: > Hi, I think you can use nodefs. Here's a test : > https://github.com/emscripten-core/emscripten/blob/master/tests/fs/test_nodefs_rw.c > > On Sat, Dec 7, 2019, 09:51 Shi Yan <[email protected]> wrote: > >> I created a wasm program with a preloaded folder /asset >> >> the program, upon finish, will generate a file log.txt under >> /asset/log.txt. >> >> How can I get this file? >> >> I run the program with node.js. It runs fine, but I don't know where to >> get the result file back. Thanks >> >> -- >> You received this message because you are subscribed to the Google Groups >> "emscripten-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/emscripten-discuss/0753311c-5ec0-49db-be7e-7ceb1db86efd%40googlegroups.com >> <https://groups.google.com/d/msgid/emscripten-discuss/0753311c-5ec0-49db-be7e-7ceb1db86efd%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/CANLCaykMNORtj%2BLKpHsbYEeHskY%3D4EgzGauzvyTanqidw%2BG2pQ%40mail.gmail.com > <https://groups.google.com/d/msgid/emscripten-discuss/CANLCaykMNORtj%2BLKpHsbYEeHskY%3D4EgzGauzvyTanqidw%2BG2pQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpQgYOpMYLC98ODfzO8myieMr7rSd_pLqo57QxtTxv6yQg%40mail.gmail.com.
