fs.readFile[Sync]("/dev/stdin") does not always read the entire file #1070
Labels
confirmed-bug
Issues with confirmed bugs.
fs
Issues and PRs related to the fs subsystem / file system.
Originally reported here: nodejs/node-v0.x-archive#7412
The root cause of the issue is that
fs.readFile()
stats the file and reads the amount of bytes specified in thest_size
field. This works only for regular files.The fix would be to check whether the ST_IFREG flag is set. If not, use a slower but more reliable method to read the entire file.
I think this is a "good first bug" for new contributors.
The text was updated successfully, but these errors were encountered: