Can I read files from the disk by using Webassembly?

前端 未结 2 1317
后悔当初
后悔当初 2021-01-01 14:49

I followed the Webassembly getting started tutorial http://webassembly.org/getting-started/developers-guide/

It worked fine and displayed the \"Hello, world!\" messa

2条回答
  •  执念已碎
    2021-01-01 15:04

    You can package files or directories into the WASM virtual file system using the --embed-file flag.

    In your case this would look like:

    emcc pfile.cpp -s WASM=1 -o pfile.html -v --embed-file test.txt

    Docs: https://kripken.github.io/emscripten-site/docs/porting/files/packaging_files.html

提交回复
热议问题