Is it possible to use OPFS backend with -sASYNCIFY=1
?
#21666
Answered
by
brendandahl
pashokitsme
asked this question in
Q&A
-
Hi.
I saw that code about jspi/pthread but maybe there is another way to use OPFS? If i compiling with (or without but it obviously ends up with an error in runtime) Example code which runs in main thread for jspi and in worker for everything else #include <emscripten.h>
#include <emscripten/wasmfs.h>
#include <stdio.h>
int main(void) {
backend_t opfs_backend = wasmfs_create_opfs_backend();
int err = wasmfs_create_directory("/opfs", 0777, opfs_backend);
if (err) {
fprintf(stderr, "wasmfs_create_directory err: %d\n", err);
return err;
}
FILE *file = fopen("/opfs/x", "wb");
if (!file) {
fprintf(stderr, "fopen err\n");
return -1;
}
return 0;
} Flags i used:
|
Beta Was this translation helpful? Give feedback.
Answered by
brendandahl
Apr 2, 2024
Replies: 1 comment 8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We haven't done any work to implement it, so I'd say it's more a missing feature.