EMFILE: current process is out of file descriptors
ENFILE: system is out of file descriptors
The fs.rmdir() logic in lib/internal/fs/rimraf.js currently handles the former but not the latter:
|
if (err.code === 'EMFILE' && timeout < options.emfileWait) |
|
return setTimeout(_rimraf, timeout++, path, options, CB); |
Both are (hopefully) transient errors though and should be handled identically.
Since ENFILE is difficult to test for, I think it's okay to omit a regression test.