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

Function forceLoadFile

sqlite-wasm-cos/sqlite3-node.mjs:2878–2889  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

2876 return FS.mkdev(path, mode, dev);
2877 },
2878 forceLoadFile(obj) {
2879 if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
2880 if (globalThis.XMLHttpRequest) {
2881 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.");
2882 } else { // Command-line.
2883 try {
2884 obj.contents = readBinary(obj.url);
2885 } catch (e) {
2886 throw new FS.ErrnoError(29);
2887 }
2888 }
2889 },
2890 createLazyFile(parent, name, url, canRead, canWrite) {
2891 // Lazy chunked Uint8Array (implements get and length from Uint8Array).
2892 // Actual getting is abstracted away for eventual reuse.

Callers

nothing calls this directly

Calls 1

abortFunction · 0.70

Tested by

no test coverage detected