ruby/ruby.wasm

Accessing files and directories?

Opened this issue · 0 comments

It seems the current working directory is /, in ruby.wasm. By default this appears
to be empty - I tried via Dir['*'].

I also don't seem to be able to create anything, or read from files.

I'd love to be able to do both, but reading from a file is more important. My initial
idea was to "componentize" my smaller gems into Strings that can be evaluated
via ruby.wasm. But if I can not read any file or find them then this strategy does
not work.

Is there a way to query a file's content still? Even javascript has that option available
at the least if you e. g. place a .js file onto the webserver and then load it locally.

Right now I am not sure how to do this via ruby.wasm which kind of limits the way
I can use it. At any rate, thank you for reading this.