tokio-rs / io-uring

The `io_uring` library for Rust
Apache License 2.0
1.19k stars 131 forks source link

Is direct I/O supported? #292

Open zRegle opened 3 months ago

zRegle commented 3 months ago

Can I open a file with custom flags like O_DIRECT?

I noticed that there is no custom_flags method in tokio_uring::fs::OpenOptions, unlike tokio::fs::OpenOptions. Is there any alternative way?

Thx in advanced!

ozgrakkurt commented 1 month ago

tokio_uring doesn't have much real support for direct_io. In this io_uring library it just takes flags: u64 though so you can do it but it is very low level https://docs.rs/io-uring/latest/io_uring/opcode/struct.OpenAt2.html