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

statx builder #226

Merged
merged 7 commits into from
Feb 14, 2023
Merged

statx builder #226

merged 7 commits into from
Feb 14, 2023

Conversation

FrankReh
Copy link
Collaborator

@FrankReh FrankReh commented Feb 5, 2023

Add a builder for the statx command, tokio_uring::fs::StatxBuilder.

Also adds a tokio_uring::fs::statx() function.

Also adds test cases for these functions to the poorly named example: test_create_dir_all.

This adds a top level statx function that takes a path obviating the
need to open a file first.

This also adds a builder, named StatxBuilder, to give more control over
the dirfd, path, flags and mask that are ultimately being passed to the
uring statx operation.

The builder can be gotten with or without an open file.

Also add statx tests to the example, test_create_dir_all.
Stores the cloned SharedFd in the builder, rather than a reference to
the File. The clone was going to be made anyway.
And removes the statx_path(path) terminator to the builder.
The builder api is both simplificied and made more complex.

Simplied because there is just one terminator now, statx().

More complex because the pathname(path) option can fail to create a
CString so needs to return an io::Result<&mut Self> so the builder's
chain of options has this little hiccup in it when setting the path.
@FrankReh FrankReh requested a review from Noah-Kennedy February 6, 2023 03:37
@FrankReh FrankReh merged commit c4320fa into tokio-rs:master Feb 14, 2023
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