Ask questionsFile.writeSync(buf) - does not write buffer more than 16384 bytes
When a buffer is writting to a file synchronously, a buffer larger than 16384 is truncated without warning and is not written to the file!
deno 0.32.0 v8 8.1.108 typescript 3.7.2
Code Example: `const buf_size = 40960 //4096 - standard value //16384 - max allowed value !!! const buf = new Uint8Array(buf_size) buf.fill(0x31)
const fn = './deno_file_write_bug.txt' const f = Deno.openSync(fn, 'w') f.writeSync(buf) f.close()
const fi = Deno.lstatSync(fn) console.log(fi.len === buf_size ? true : fi.len)`
Answer questions ry
oops I thought this was about writeFileSync... You're right @afinch7.
@balajahe - write is a low-level I/O call and it does not guarantee the whole buffer will be written. Have a look at