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

feat: walk_dir function (finds all files in sub directories) #6530

Closed
wants to merge 1 commit into from

Conversation

ali77gh
Copy link

@ali77gh ali77gh commented May 3, 2024

Motivation

I was working on my personal project and using Tokio as my runtime. I needed to walk through directories recursively, find files, and perform other tasks. I struggled a lot to accomplish this with Tokio, which made me wonder why there is no walk function in Tokio's file system module. It seems like a lightweight and useful feature to have.
Python, for instance, has os.walk in its standard library.

Solution

With all that said, I added the walk_dir() function to tokio::fs to make it easier for others to search over files recursively
using Tokio.

If there is any type of problem in this pull request. Just let me know.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-fs Module: tokio/fs labels May 3, 2024
@Darksonn
Copy link
Contributor

Darksonn commented May 3, 2024

I don't want to add this because there is no std::fs equivalent.

@Darksonn Darksonn closed this May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-fs Module: tokio/fs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants