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

Function writeFile

sqlite-wasm-cos/sqlite3-node.mjs:2591–2597  ·  view source on GitHub ↗
(path, data, opts = {})

Source from the content-addressed store, hash-verified

2589 return buf;
2590 },
2591 writeFile(path, data, opts = {}) {
2592 opts.flags = opts.flags || 577;
2593 var stream = FS.open(path, opts.flags, opts.mode);
2594 data = FS_fileDataToTypedArray(data);
2595 FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn);
2596 FS.close(stream);
2597 },
2598 cwd:() => FS.currentPath,
2599 chdir(path) {
2600 var lookup = FS.lookupPath(path, { follow: true });

Callers

nothing calls this directly

Calls 4

FS_fileDataToTypedArrayFunction · 0.70
openMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected