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

Allow pruning dirnames in a topdown walk to improve speed on large filesystems #1223

Closed
epizut opened this issue Mar 27, 2023 · 1 comment
Closed

Comments

@epizut
Copy link
Contributor

epizut commented Mar 27, 2023

Allowing modifying dirnames in order to improve browsing large filesystems:

os.walk

When topdown is True, the caller can modify the dirnames list in-place (perhaps using del or slice assignment),
and walk() will only recurse into the subdirectories whose names remain in dirnames;
this can be used to prune the search, impose a specific order of visiting, or even to inform walk()
about directories the caller creates or renames before it resumes walk() again.

Related issue: Add topdown kwarg to AbstractFileSystem.walk()

@ianthomas23
Copy link
Collaborator

Fixed by #1263.

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