Skip to content
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

[Suggestion] Prevent usage of openSync #22

Open
werneazc opened this issue Apr 20, 2020 · 0 comments
Open

[Suggestion] Prevent usage of openSync #22

werneazc opened this issue Apr 20, 2020 · 0 comments

Comments

@werneazc
Copy link

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant