Version
v21.1.0
Platform
Linux ubuntu 6.2.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
fs/promises
What steps will reproduce the bug?
Compare the length of the content returned by fs/promises.readFile and fs.readFile when reading any file larger than 4 KiB in /proc/net. fs/promises only returns the first 4 KiB or so.
$ node
Welcome to Node.js v21.1.0.
Type ".help" for more information.
> require("fs/promises").readFile("/proc/net/unix", "utf-8").then(x => console.log(x.length))
Promise {
<pending>,
[Symbol(async_id_symbol)]: 31,
[Symbol(trigger_async_id_symbol)]: 25
}
> 4059
require("fs").readFile("/proc/net/unix", "utf-8", (_, x) => console.log(x.length))
undefined
> 65432
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
fs/promises's readFile and fs.readFile return the same untruncated file contents.
What do you see instead?
fs/promises's readFile truncates procfs file contents to around 4 KiB.
Additional information
No response
Version
v21.1.0
Platform
Linux ubuntu 6.2.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
fs/promises
What steps will reproduce the bug?
Compare the length of the content returned by
fs/promises.readFileandfs.readFilewhen reading any file larger than 4 KiB in/proc/net.fs/promisesonly returns the first 4 KiB or so.How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
fs/promises'sreadFileandfs.readFilereturn the same untruncated file contents.What do you see instead?
fs/promises'sreadFiletruncates procfs file contents to around 4 KiB.Additional information
No response