Skip to content

LocalFileSystem: use read_at instead of seek + read #622

Closed

Description

@Dandandan

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Currently, the LocalFileSystem uses seek followed by a read, which saves a syscall per request.

Describe the solution you'd like

We should be able to use read_at instead (https://doc.rust-lang.org/std/os/unix/fs/trait.FileExt.html
It is available for unix (linux/osx / windows):

// Platform specific traits needed for read_at
#[cfg(unix)]
use std::os::unix::fs::FileExt; 
#[cfg(windows)]
use std::os::windows::fs::FileExt;

let file = Arc::new(File::open(path)?);
file.read_at(&mut buf, 500).unwrap();
...

Describe alternatives you've considered

Additional context

Activity

  1. AdamGS commented on Jan 27, 2026

    @AdamGS
    Contributor

    glad to take this if you didn't get started

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions