-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
readlineIssues and PRs related to the built-in readline module.Issues and PRs related to the built-in readline module.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
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: fooIn v2.3.2+, first line is ignored, and second line is accepted:
foo
bar
INPUT: barThis 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)
Metadata
Metadata
Assignees
Labels
readlineIssues and PRs related to the built-in readline module.Issues and PRs related to the built-in readline module.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.