Skip to content

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

Closed
ali77gh wants to merge 1 commit into
tokio-rs:masterfrom
ali77gh:walker
Closed

ali77gh wants to merge 1 commit into
tokio-rs:masterfrom
ali77gh:walker

Conversation

@ali77gh

@ali77gh ali77gh commented May 3, 2024

Copy link
Copy Markdown

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

Darksonn commented May 3, 2024

Copy link
Copy Markdown
Member

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.

2 participants