Skip to content

[Suggestion] Prevent usage of openSync #22

@werneazc

Description

@werneazc

Are the following lines in lib/index.js really necessary?

this.fd = fs.openSync(this.device, this.flags);
this.input = fs.createReadStream(null, this);

At least, you do not check for a valid file descriptor first. So why not forward the device string directly to the createReadStream function instead of null?

this.input = fs.createReadStream(this.device, this);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions