MCPcopy Create free account
hub / github.com/brimdata/super / writeSync

Function writeSync

book/super-example/wasm_exec.js:18–26  ·  view source on GitHub ↗
(fd, buf)

Source from the content-addressed store, hash-verified

16 globalThis.fs = {
17 constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1, O_DIRECTORY: -1 }, // unused
18 writeSync(fd, buf) {
19 outputBuf += decoder.decode(buf);
20 const nl = outputBuf.lastIndexOf("\n");
21 if (nl != -1) {
22 console.log(outputBuf.substring(0, nl));
23 outputBuf = outputBuf.substring(nl + 1);
24 }
25 return buf.length;
26 },
27 write(fd, buf, offset, length, position, callback) {
28 if (offset !== 0 || length !== buf.length || position !== null) {
29 callback(enosys());

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected