MCPcopy Index your code
hub / github.com/tinygo-org/tinygo / writeSync

Function writeSync

targets/wasm_exec.js:45–53  ·  view source on GitHub ↗
(fd, buf)

Source from the content-addressed store, hash-verified

43 global.fs = {
44 constants: { O_WRONLY: -1, O_RDWR: -1, O_CREAT: -1, O_TRUNC: -1, O_APPEND: -1, O_EXCL: -1 }, // unused
45 writeSync(fd, buf) {
46 outputBuf += decoder.decode(buf);
47 const nl = outputBuf.lastIndexOf("\n");
48 if (nl != -1) {
49 console.log(outputBuf.substr(0, nl));
50 outputBuf = outputBuf.substr(nl + 1);
51 }
52 return buf.length;
53 },
54 write(fd, buf, offset, length, position, callback) {
55 if (offset !== 0 || length !== buf.length || position !== null) {
56 callback(enosys());

Callers

nothing calls this directly

Calls 1

logMethod · 0.80

Tested by

no test coverage detected