5

I have an application that contains libraries generated with emscripten. I am compiling them using the flags:

-s MODULARIZE=1 -s EXPORT_NAME=\"'SomeModuleName'\"

However, the library FS is no longer available. When I was compiling without the flags, I could use the library FS in any other script.

Is it possible to export FS in my module?

Juan
  • 806
  • 1
  • 8
  • 15
  • I just ran into this post https://groups.google.com/forum/#!topic/emscripten-discuss/_K61fo-9oKY The solution then will be to include all source in the same Module. – Juan Nov 10 '15 at 05:51
  • How to export FS: https://github.com/kripken/emscripten/issues/3167#issuecomment-155523425 Update: Library https://github.com/jvilk/BrowserFS might help solve this issue. BrowserFS could be used to manage the shared space between modules. Read and write operations done by BrowserFS and the modules will use the buffers to do operations on the data. – Juan Nov 16 '15 at 15:39
  • It looks like you've found a solution at https://github.com/kripken/emscripten/issues/3167#issuecomment-155523425 . If that's the case, can you post that information as an answer? – Michal Charemza Nov 21 '15 at 16:43

1 Answers1

5

The FS module is not exported by default when using the flag

-s EXPORT_NAME="'SomeModuleName'"

If you want to export the module FS, you have to add the flag

-s 'EXTRA_EXPORTED_RUNTIME_METHODS=["FS"]'

Then you can access Module['FS'] or for this example it will be SomeModuleName['FS'] emscripten.

However, FS is defined by each library and it won't be shared between them. If you would like to have a 'common' shared space between libraries, you will need to use something like BrowserFS

Juan
  • 806
  • 1
  • 8
  • 15