(fd, buf)
| 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()); |