MCPcopy Create free account
hub / github.com/GoogleChrome/samples / forceLoadFile

Function forceLoadFile

sqlite-wasm-cos/sqlite3.mjs:2999–3010  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

2997 return FS.mkdev(path, mode, dev);
2998 },
2999 forceLoadFile(obj) {
3000 if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
3001 if (globalThis.XMLHttpRequest) {
3002 abort("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
3003 } else { // Command-line.
3004 try {
3005 obj.contents = readBinary(obj.url);
3006 } catch (e) {
3007 throw new FS.ErrnoError(29);
3008 }
3009 }
3010 },
3011 createLazyFile(parent, name, url, canRead, canWrite) {
3012 // Lazy chunked Uint8Array (implements get and length from Uint8Array).
3013 // Actual getting is abstracted away for eventual reuse.

Callers

nothing calls this directly

Calls 1

abortFunction · 0.70

Tested by

no test coverage detected