Closed
Description
iojs 1.8.1
Linux Mint 17, x64, 3.13.0-24
function formatString(n) {
var str = '';
while (str.length < n) {
str = str + ' ' + str.length;
}
return str;
}
var fs = require('fs')
, str = formatString(100000)
, buffer = new Buffer(str + '\n', 'utf8');
fs.writeSync(process.stdout.fd, buffer, 0, buffer.length, null);
Running this script produces a truncated output. Here is a tail of it ... 77530 77536 77542 77548 77554 77560 7
.
Replacing fs.writeSync(process.stdout.fd, buffer, 0, buffer.length, null)
with console.log(str)
changes output. Now the full string is output correctly. Tail is ... 9964 99970 99976 99982 99988 99994
.