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

EMFILE when using fse.readFile #862

Closed
chscott opened this issue Jan 20, 2021 · 2 comments
Closed

EMFILE when using fse.readFile #862

chscott opened this issue Jan 20, 2021 · 2 comments

Comments

@chscott
Copy link

chscott commented Jan 20, 2021

  • Operating System: Windows
  • Node.js version: 12.8.1
  • fs-extra version: 9.0.1

I'm seeing the following with this code snippet and a large number of files being read:

const contents = await FSE.readFile(path, {
        encoding: 'utf8',
        flag: 'r',
      })
2021-01-19 16:25:47:147 - error: [main] Error: EMFILE: too many open files, open 'C:\ProgramData\foo.dat'

The readme indicates fs-extra uses graceful-fs to prevent EMFILE errors, but I also see some issues where it was reported that fs-extra wasn't using EMFILE in all cases. For example, #275 and #103. Is this another case where fs-extra doesn't use graceful-fs?

@RyanZim
Copy link
Collaborator

RyanZim commented Jan 20, 2021

Nope, graceful-fs is used everywhere; have you verified the full stack trace of your error to ensure it's coming from this fs-extra call?

@chscott
Copy link
Author

chscott commented Jan 20, 2021

Nope, graceful-fs is used everywhere; have you verified the full stack trace of your error to ensure it's coming from this fs-extra call?

Thanks for verifying. I suspect you are correct and that it's not coming from where I thought it was.

@chscott chscott closed this as completed Jan 20, 2021
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

2 participants