-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
filehandle.read(buffer) can't read file when options are omitted #47183
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
fs
Issues and PRs related to the fs subsystem / file system.
Comments
node/lib/internal/fs/promises.js Lines 569 to 571 in a94966f
It looks like the length is still zero here. length = buffer.byteLength - offset |
Closed
is this issue valid? please confirm. |
nodejs-github-bot
pushed a commit
that referenced
this issue
Dec 22, 2023
PR-URL: #51087 Fixes: #47183 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
RafaelGSS
pushed a commit
that referenced
this issue
Jan 2, 2024
PR-URL: #51087 Fixes: #47183 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Edit: Oh, I see #51087 probably fixes this. Sorry for the noise! @pulkit-30 I can still reproduce this on node 21.5.0 and 20.10.0 with this script: import { open } from 'fs/promises';
async function main() {
const bytes = new Uint8Array(8);
const fileHandle = await open(process.argv[2]);
console.debug(await fileHandle.read(bytes));
}
main(); Invoked like this:
Produces this output:
|
richardlau
pushed a commit
that referenced
this issue
Mar 25, 2024
PR-URL: #51087 Fixes: #47183 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Version
v18.12.1
Platform
Linux ubuntu-focal 5.4.0-144-generic #161-Ubuntu SMP Fri Feb 3 14:49:04 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
https://nodejs.org/dist/latest-v18.x/docs/api/fs.html#filehandlereadbuffer-options
Even if you omit
options
, it will be default values.What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: