-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.
Description
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
amtrack
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.linuxIssues and PRs related to the Linux platform.Issues and PRs related to the Linux platform.promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.