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

create_dir_all and DirBuilder #224

Merged
merged 3 commits into from
Feb 4, 2023

Conversation

FrankReh
Copy link
Collaborator

@FrankReh FrankReh commented Feb 4, 2023

uring, therefore async, versions of create_dir_all and DirBuilder.

This provides an async version of the std library function and type of
the same names.

This is the first step in getting purely async-uring implementions. It
remains to replace the is_dir functionality of the std library's Path
with an async-uring version of the function.

There also remains a possible performance improvement if someone wants
to replace the async recursive function.
@FrankReh
Copy link
Collaborator Author

FrankReh commented Feb 4, 2023

For now, this comes with an example binary that was useful in development and testing of the feature. It doesn't make a create example for normal uring use though so I'm happy to consider it temporary and we can remove it as part of this PR or any time later.

Also there is an async version of is_dir that is used solely by this feature which may be useful in its own right one day or at least parts of it as it has to look at libc bits of the statx structure and asking whether a path or a File is a directory is fairly common so there are normally helper functions or methods provided for that. For now our statx call returns a libc::statx structure so the caller is own their own to track down the details of how to do it.

@FrankReh FrankReh requested a review from Noah-Kennedy February 4, 2023 20:46
@FrankReh FrankReh merged commit afab7f2 into tokio-rs:master Feb 4, 2023
@FrankReh FrankReh deleted the frankreh/create_dir_all branch February 4, 2023 22:02
@FrankReh
Copy link
Collaborator Author

FrankReh commented Feb 4, 2023

FYI. I'm working on a builder version of statx and that will allow getting the statx structure without first having opened the file, so the is_dir function in this create_dir_all can be greatly simplified after that.

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

Successfully merging this pull request may close these issues.

2 participants