Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

Line reader doesn't close open files, results in "too many open files" error. #32

Closed
jarod2d opened this issue Jul 7, 2012 · 2 comments

Comments

@jarod2d
Copy link

jarod2d commented Jul 7, 2012

Line readers open files but don't ever close them. If you create enough line readers you'll get the error EMFILE, too many open files. The files need to be closed to avoid this.

There isn't really a way for the line reader to close the file automatically because it doesn't know when the user is done with it, so the user will need to close the file themselves. Currently they can do so by doing something like fs.closeSync(reader.fd), but this isn't documented -- they'll need to look at the source to know that they can grab the file descriptor from the reader.

This should be documented in the readme, and perhaps a function should be added to the line reader that performs the close for you.

ryanmcgrath pushed a commit that referenced this issue Nov 9, 2012
@ryanmcgrath
Copy link
Owner

Done. 4 months late, but done.

@jarod2d
Copy link
Author

jarod2d commented Nov 9, 2012

Awesome, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants