Skip to content

std::fs::walk_dir never closes directories #25184

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

Closed
clee opened this issue May 7, 2015 · 1 comment
Closed

std::fs::walk_dir never closes directories #25184

clee opened this issue May 7, 2015 · 1 comment

Comments

@clee
Copy link

clee commented May 7, 2015

I wrote a small utility to recursively parse time data from files in a given root directory, and when I try to run it on my $HOME it errors out with:

Error { repr: Os(24) }

According to the devs in #rust, this is the error code for 'too many open files'. After looking at the code for walk_dir, it looks like it never calls closedir, which would explain why this is happening for me.

@alexcrichton
Copy link
Member

We do actually call closedir when the ReadDir value goes out of scope, so I don't believe that's a problem. This is likely a dupe of #23715, however, so I'm going to close in favor of that, but thanks for the report!

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