I followed the Webassembly getting started tutorial http://webassembly.org/getting-started/developers-guide/
It worked fine and displayed the \"Hello, world!\" messa
Keep secure — WebAssembly is specified to be run in a safe, sandboxed execution environment. Like other web code, it will enforce the browser's same-origin and permissions policies.
So the short answer is — yes, there are restrictions. You have no access to files on disks. You just have block of memory, WASM code could be called from JS and also WASM could call JS functions.
But, there's one interesting feature in Emscripten — in the WASM you can have your own "virtual" file system with files. You can use it to "attach" some const files during compilation time and read them at the execution time. See https://kripken.github.io/emscripten-site/docs/api_reference/Filesystem-API.html
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