tokio-uring icon indicating copy to clipboard operation
tokio-uring copied to clipboard

Add missing filesystem operations

Open kaimast opened this issue 4 years ago • 9 comments

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:

  • [x] create_dir
  • [ ] read_dir
  • [x] remove_dir
  • [ ] remove_dir_all

Files:

  • [ ] metadata
  • [x] rename
  • [ ] copy
  • [x] 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 avatar Aug 19 '21 19:08 kaimast

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.

kaimast avatar Dec 31 '21 20:12 kaimast

Yes, there should be a release soon.

Noah-Kennedy avatar Jan 07 '22 16:01 Noah-Kennedy

@kaimast version 0.2.0 has been released.

Noah-Kennedy avatar Jan 09 '22 20:01 Noah-Kennedy

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

kaimast avatar Jan 09 '22 20:01 kaimast

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

kaimast avatar Dec 17 '22 20:12 kaimast

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

FrankReh avatar Dec 17 '22 21:12 FrankReh

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

Icelk avatar Mar 29 '23 16:03 Icelk

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.

FrankReh avatar Mar 29 '23 18:03 FrankReh

I understand. Thanks.

Icelk avatar Mar 29 '23 19:03 Icelk