node-filewalker
node-filewalker copied to clipboard
stream event: Error: EMFILE: too many open files
When attaching a handler to stream event, recursively traversing a larger amount of files in a folder using node-filewalker, an error message occurs (usually at the same point (12114 files)):
[...]
Error: EMFILE: too many open files[...]
[...]
The ReadStream is even closed in the stream event handler, but this doesn't have an effect.
Windows 10 Home Premium x64, node v4.4.5, node-filewalker v0.1.3
Did you try the maxPending
option?
Wouldn't it be a good feature if node-filewalker determines/find out retry what the limit currently is? Could node-graceful-fs be integrated?
This was/is in fact the next feature that should be integrated:
https://github.com/oleics/node-filewalker/blob/58a0bff/lib/filewalker.js#L92
Linking detectedMaxOpen
and maxPending
if a flag is enabled should do the trick ;)
Using graceful-fs
(which is a great node-module) could have negative impacts on performance.