-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Use RAWNODEFS with MEMFS on the same module #23566
Comments
What about using |
The point of NODERAWFS is to subsume / replace the whole FS, so you cannot mix with other filesystem times. However, that is exactly what |
Thanks for this example, very helpful. But it doesn't do the entire job. Because it traverses the "/" and mount each directory, I cannot do something like create a new directory on the root /, because it would create on MEMFS.
I don't want to mix, I want to replace it, but at runtime. Mounting the root directory in a /root doesn't work because it would create different directory calls and I want it to be transparent -> |
Can you explain a little more. Under what circumstances to you want to use the real node FS and under what circumstances do you want to use the emscripten VFS? What if we allowed NODEFS to be mounted at the root |
Does your application create new directories in the root directory? That seems like very unusual thing to want to do (or be able to do). |
Actually, if you tried to do this (create directories in the root) with NODERAWFS wouldn't it fail with permission errors? Or are you running node as root on your system? |
I think a potentially useful feature would be to be able to make a single binary that uses noderawfs in node and uses memfs in browsers. But using nodefs is a good enough approximation that it might not be worth the effort to implement this. |
Yes, I would hope that nodefs would be good enough in this case. But I'm trying to understand better the OP's exact use case to be sure. |
I want to be able to choose between both. This is my project: https://github.com/ceifa/wasmoon
Yes, I think it would fit. That is exactly what I tried at first, but because MEMFS is the default, it didn't work.
My library is a platform for running code in Lua, people can use it in many ways. I just would like to have it work as same as the real Lua C binary, to enable more use cases. But actually I think you are quite right, I don't see a use-case for that, the python repo solution may fit great for now. I will make more tests on it. Thank you very much guys. |
I have a library that uses emscripten, and I would like to add an option for the consumer to use MEMFS or RAWNODEFS.
I tried adding to the compilation
-lnoderawfs.js -lnodefs.js
, but the RAWNODEFS replaces the MEMFS automatically, on the following lines:Is it possible to import the MEMFS and NODERAWFS, but choose at runtime which one to use?
The text was updated successfully, but these errors were encountered: