writeFile fixes
authorisaacs <i@izs.me>
Sun, 14 Nov 2010 04:12:47 +0000 (20:12 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Sun, 14 Nov 2010 09:43:30 +0000 (01:43 -0800)
commit589e27948ba3a08651514f7d88574ad9f5200969
tree09ff7bb64c22507691e860022534ae2df4171699
parentd787a444c5f54d468703b1d316e4e22a59ea7033
writeFile fixes

writeFileSync could exhibit pathological behavior when a buffer could
not be written to the file in a single write() call.

Also, writeFile was not quite as optimized as it could be.
lib/fs.js
test/simple/test-fs-write-file-buffer.js [new file with mode: 0644]