Closed
Description
I tried read from STDIN by fs.readSync
that is given process.stdin.fd
.
For example:
var
fs = require('fs'),
buffer = new Buffer(1024),
fd = process.platform === 'win32' ? process.stdin.fd : fs.openSync('/dev/tty', 'r'),
readSize = fs.readSync(fd, buffer, 0, 1024);
console.log('INPUT: ' + buffer.toString('utf8', 0, readSize));
In v2.3.1-, no problem:
foo
INPUT: foo
In v2.3.2+, first line is ignored, and second line is accepted:
foo
bar
INPUT: bar
This problem occurs in only Windows + iojs v2.3.2+.
I don't use process.stdin.fd
in non-Win because fs.readSync
can't read it.
Therefore, process.stdin
of v2.3.2+ might have problem. (not fs.readSync
)