-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.stdioIssues and PRs related to stdio.Issues and PRs related to stdio.v18.xIssues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
- Version:
v9.11.1 - Platform:
Windows 10 Pro (64-bit; v10.0.15063) - Subsystem:
fsmodule
On Windows, run the following from a cmd.exe console ("Command Prompt"):
:: Echo stdin input
:: OK: Nonempty stdin input.
echo hi | node -pe "require('fs').readFileSync(0).toString()"
:: BREAKS ON WINDOWS: no stdin input, which should *prompt* for it when run in a terminal.
node -pe "require('fs').readFileSync(0).toString()"
:: BREAKS ON WINDOWS: stdin input closed; should return an empty line.
node -pe "require('fs').readFileSync(0).toString()" < NULThe last 2 commands break as follows:
fs.js:531
binding.fstat(fd);
^
Error: EISDIR: illegal operation on a directory, fstat
at tryStatSync (fs.js:531:13)
at Object.fs.readFileSync (fs.js:567:3)
...
Using .readFile() and the readline module is equally affected.
On Unix platforms, the behavior is as expected in all cases.
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.stdioIssues and PRs related to stdio.Issues and PRs related to stdio.v18.xIssues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.Issues that can be reproduced on v18.x or PRs targeting the v18.x-staging branch.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.