-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two types of filehandle.read
return different values
#41558
Comments
I get the same result even if I reverse the order of execution, but is it expected behavior? const result2 = await fh.read({ buffer, offset, length, position }); // => { bytesRead: 0, buffer: Uint8Array(4) [ 0, 1, 2, 3 ] }
const result1 = await fh.read(buffer, offset, length, position); // => { bytesRead: 4, buffer: Uint8Array(4) [ 0, 1, 2, 3 ] } |
@nodejs/fs |
@christian102094 Thanks for the information. Sorry, I was not aware of those closed issues. Should I close this issue? |
@nujarum if you can verify this works for you in latest node that'd be helpful - after that sure! Thanks for the report btw. |
Sorry for late reply. I have confirmed that this has been fixed in the latest version
const result2 = await fh.read({ buffer, offset, length, position });
// => result2: { bytesRead: 4, buffer: Uint8Array(4) [ 0, 1, 2, 3 ] } Now that I understand the cause of this problem, I am going to close this issue. (I hope this will be fixed in the LTS versions, v14 and v16. 😉) |
Version
v14.18.3 / v16.13.2
Platform
Microsoft Windows NT 10.0.19044.0 x64
Subsystem
fs/promises
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
I think the expected behavior is that these two return values are the same.
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: