Alternative to std::fs::file

⚓ Rust    📅 2026-03-13    👤 surdeus    👁️ 2      

surdeus

I am wondering about an alternative way of accessing files.

I am no expert on the topic, but I believe Linux (well Posix?) has primitives pread and pwrite, which take a file position, avoiding the need to seek to the correct position first ( saving a kernel call). It is also IMO awkward to have to mutate state to read a file, and std:fs::file is not Sync when I think an alternative could be. So I was wondering about the practicality of making a struct for this, or maybe a crate already exists?

( Some 14-year-old stack overflow discussion here )

7 posts - 4 participants

Read full topic

🏷️ Rust_feed