You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Note: This is the first of several issues. I'm happy to send PRs for some/all of these, but most need some discussion first.]
When running cat with stdin redirected from a file yields the following result:
$ ./bin/cat < ./index.js
/tmp/posix-cat/bin/cat:9
cat.on('end', process.stdin.end.bind(process.stdin))
^
TypeError: Cannot read property 'bind' of undefined
at Object.<anonymous> (/media/linuxdata/kevin/tmp/posix-cat/bin/cat:9:32)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:134:18)
at node.js:962:3
This is because process.stdin is tty.ReadStream when stdin is a TTY and fs.ReadStream when it is a file.
Do you recall the reason for calling .end() here?
Thanks,
Kevin
The text was updated successfully, but these errors were encountered:
[Note: This is the first of several issues. I'm happy to send PRs for some/all of these, but most need some discussion first.]
When running
cat
withstdin
redirected from a file yields the following result:This is because
process.stdin
istty.ReadStream
whenstdin
is a TTY andfs.ReadStream
when it is a file.Do you recall the reason for calling
.end()
here?Thanks,
Kevin
The text was updated successfully, but these errors were encountered: