-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
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.
Description
- Version: 10.4.1
- Platform: Amazon Linux 2, kernel 4.14 x64
- Subsystem: fs, experimental promises api
const fs = require('fs')
fs.promises.readFile('/proc/stat', { encoding: 'utf8' }).then(r => console.log(r.length)) // => 0
fs.readFile('/proc/stat', { encoding: 'utf8' }, (e, r) => console.log(r.length)) // => 2347
console.log(fs.readFileSync('/proc/stat', { encoding: 'utf8' }).length) // => 2347
I'm not sure how promises API differs from classic one, but this behaviour is surprising, and I can't find anything in the docs that would explain what I am doing wrong…
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.