If you don't need the fopen/fread/fclose functions, the easiest way to load 
data on demand is emscripten_async_wget_data():

 
https://emscripten.org/docs/api_reference/emscripten.h.html#c.emscripten_async_wget_data

...this performs a XmlHttpRequest and on success invokes a callback 
function with a pointer to the loaded file data in memory, and its size.

Cheers,
-Floh.

On Thursday, 2 May 2019 01:52:21 UTC+2, Zajo wrote:
>
> Greetings!
>
> From reading the documentation, when files are preloaded, they get packed 
> in a single .data file. Is my understanding correct, that in order for any 
> file to be opened for reading from C (e.g. by calling fopen), the whole 
> .data file must be downloaded? Is there any way to open files hosted on a 
> web server and read them synchronously on demand, as each individual file 
> is fopen-ed?
>
> Actually I don't even need the full file I/O interface defined by ANSI C; 
> I just need the ability to open a stream, then read sequentially, until 
> EOF. Is there some emscripten-specific API that I can use for this purpose?
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to