As for point 3: there's isn't really a useful way in HTTP to check if a file exists, apart from firing a request and checking the returned HTTP status (the emscripten_async_wget function would call the onerror callback in that case).
What I do usually is to create a table-of-content (TOC) file in an offline-build process, this contains all existing files on the web servers, and sometimes additional information like file size and MD5 hash. The TOC file is downloaded first and stored in a map/dictionary in RAM. When the actual asset files are loaded, an exists-check is done first through the TOC, thus if a file doesn't exist no server round-trip is necessary. You can also check for the existence of directories, and iterate over their contents, since all this information is in the TOC-file (and HTTP doesn't provide this functionality). Cheers, -Floh. Am Donnerstag, 15. Oktober 2015 19:41:19 UTC+2 schrieb Robert Goulet: > > Hi all, > > I have a few questions about asynchronous file system API: > > 1. Can we use emscripten_async_wget or other async methods before we > enter the emscripten main loop? > 2. The documentation says "*In addition to fetching the URL from the > network, the contents are prepared so that the data is usable in IMG_Load > and so forth...*" Is this still true in *1.34.12*? I recall there was > a change to disable content preparation by default; does this apply to > these functions or are they still preparing content? > 3. I don't see any API to verify if a file exist before we async wget > it, would it be possible to add an API that only tell us if the file exist > on the server? > > In our engine, the way it currently is we load resources asynchronously, > but it must be completed before we start the update/render loop. Would that > be an architecture issue? > > Thanks! > -- 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 emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.