-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
filehandle.read(buffer) can't read file when options are omitted #47183
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 |
deokjinkim
added
the
fs
Issues and PRs related to the fs subsystem / file system.
label
Mar 21, 2023
deokjinkim
changed the title
Can not read file.
filehandle.read(buffer) can't read file when options are ommitted
Mar 21, 2023
mscdex
changed the title
filehandle.read(buffer) can't read file when options are ommitted
filehandle.read(buffer) can't read file when options are omitted
Mar 21, 2023
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 <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
RafaelGSS
pushed a commit
that referenced
this issue
Jan 2, 2024
PR-URL: #51087 Fixes: #47183 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
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 <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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: