Skip to content

NODEFS and NODERAWFS broken since v3.1.45 with node < v18.3.0 #21118

Closed
@mzoliker

Description

@mzoliker

Hi,

In #20077 the functions fs.readSync and fs.writeSync have been updated with signatures that did not exist in node v10.19.0 (for instance fs.writeSync with options was only added in node v18.3.0), which breaks running with any earlier version of node.

The four occurrences should really be rewritten as follows for them to work as expected as from node v10.19.0:

return fs.readSync(stream.nfd, new Int8Array(buffer.buffer, offset, length), 0, length, position);
return fs.writeSync(stream.nfd, new Int8Array(buffer.buffer, offset, length), 0, length, position);
var bytesRead = fs.readSync(stream.nfd, new Int8Array(buffer.buffer, offset, length), 0, length, position);
var bytesWritten = fs.writeSync(stream.nfd, new Int8Array(buffer.buffer, offset, length), 0, length, position);

Thanks a lot for the fix!

Kind regards,
Maurice

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions