-
-
Notifications
You must be signed in to change notification settings - Fork 37.2k
fileHandle.read argument defaults don’t seem to work #39034
Copy link
Copy link
Closed
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
Description
Activity
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
fs/promisesWhat steps will reproduce the bug?
Save the above as
test.cjsand runnode test.cjs.How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
https://nodejs.org/api/fs.html#fs_filehandle_read_buffer_offset_length_position
Calling
fileHandle.read(buffer)should work likefileHandle.read(buffer, 0, buffer.byteLength).What do you see instead?
0 bytes are read.
Additional information
fs.readSynchas similar documentation and works as expected.Potential problems: