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

fix: too many open files error in recursive directory traversal #1419

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

borngraced
Copy link

Previously, recursive directory traversal caused excessive open file descriptors, leading to OS errors like:

eza --almost-all --recurse >/dev/null

Which was caused by directories being read too early, keeping file handles open for too long. Now, to_dir only sets up the Dir instance without reading contents and waits to read directories until needed, reducing open files

fixes: #1387

previously, recursive directory traversal led to OS errors due to too
many simultaneously open file handles.

This PR fixes that by making sure we don't read dir until we actually
need to.
@borngraced borngraced changed the title fix “too many open files” error in recursive directory traversal fix: too many open files error in recursive directory traversal Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

bug: too many open files with recursive search
1 participant