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?
constfs=require("fs/promises");asyncfunctiontest(){letpath='/path/to/file';letbuf=Buffer.alloc(4);lethandle;try{handle=awaitfs.open(path);{letbuf=Buffer.alloc(4);let{ bytesRead, buffer }=awaithandle.read(buf);//let { bytesRead, buffer } = await handle.read(buf, {}); // It is behavior I would expect.console.log(bytesRead);console.log(buffer);console.log(buf);}}finally{awaithandle?.close();}}test();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?
0
<Buffer 00 00 00 00>
<Buffer 00 00 00 00>
Additional information
No response
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