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

Add missing filesystem operations #48

Open
4 of 12 tasks
kaimast opened this issue Aug 19, 2021 · 9 comments · Fixed by #193
Open
4 of 12 tasks

Add missing filesystem operations #48

kaimast opened this issue Aug 19, 2021 · 9 comments · Fixed by #193
Labels

Comments

@kaimast
Copy link

kaimast commented Aug 19, 2021

It would be great if we could add the most important functions from tokio::fs/std::fs to this crate. As far as I can tell tokio-uring only exposes fs::File right now and none of the ones below are supported yet.

Directories:

  • create_dir
  • read_dir
  • remove_dir
  • remove_dir_all

Files:

  • metadata
  • rename
  • copy
  • remove_file

Links (I don't really need these but would be great to have):

  • symlink_metadata
  • soft_link
  • hard_link
  • read_link

This should be fairly straightforward to implement, right? I can try to take a stab at some of these once I find some time.

@kaimast
Copy link
Author

kaimast commented Dec 31, 2021

Is there going to be another io-uring release soonish? I just added a create_dir call on this branch, but it requires the git version of that crate.

@Noah-Kennedy
Copy link
Contributor

Yes, there should be a release soon.

@Noah-Kennedy
Copy link
Contributor

@kaimast version 0.2.0 has been released.

@kaimast
Copy link
Author

kaimast commented Jan 9, 2022

Thanks! I was talking about the io-uring crate though.

arashsm79 added a commit to arashsm79/tokio-uring that referenced this issue Jul 29, 2022
Implement the `rename` operation for `fs`.
This operation uses `IORING_OP_RENAMEAT` as the opcode for the submitted
SQE.

Both file descriptors are set to the special value `AT_FDCWD` so that
the given paths are interpreted relative to the current working
directory of the calling process.

The operation is submitted with a zero `flags` argument so that it would
be equivalent to the corresponding operation in `tokio:fs`/`std:fs`.

Refs: tokio-rs#48
Noah-Kennedy pushed a commit that referenced this issue Aug 1, 2022
Implement the `rename` operation for `fs`.
This operation uses `IORING_OP_RENAMEAT` as the opcode for the submitted
SQE.

Both file descriptors are set to the special value `AT_FDCWD` so that
the given paths are interpreted relative to the current working
directory of the calling process.

The operation is submitted with a zero `flags` argument so that it would
be equivalent to the corresponding operation in `tokio:fs`/`std:fs`.

Refs: #48
@kaimast kaimast mentioned this issue Dec 2, 2022
FrankReh pushed a commit that referenced this issue Dec 17, 2022
This adds a `create_dir` function call to `tokio_uring::fs` and
partially fixes #48.

I also renamed `tests/directory.rs` to `tests/fs_directory.rs` so the
name is in sync with that of `tests/fs_file.rs`.
@kaimast
Copy link
Author

kaimast commented Dec 17, 2022

We should maybe keep this open until the others are implemented too?

@FrankReh FrankReh reopened this Dec 17, 2022
@FrankReh
Copy link
Collaborator

That close seemed to have been done automatically. Anyway, no harm. Definitely some file system operations left.

@Icelk
Copy link
Contributor

Icelk commented Mar 29, 2023

Is tokio::fs::canonicalize also an operation we can support?

@FrankReh
Copy link
Collaborator

Is tokio::fs::canonicalize also an operation we can support?

The io_uring API doesn't support anything like a canonicalize (or in Unix terms, a realpath) so to avoid using the std or the tokio canonicalize, this crate, or just as easily I think, a 3rd party package, could build the logic from this crate's StatxBuilder.

That's not to say we wouldn't accept a PR that essentially duplicated a realpath based on our statx. But any suggested additions would have to be compatible with our license and I don' know if even starting with a BSD version of realpath is an acceptable approach.

@Icelk
Copy link
Contributor

Icelk commented Mar 29, 2023

I understand. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants