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

Use platform-specific read_at to read the files. #8

Merged
merged 4 commits into from
Dec 16, 2022
Merged

Commits on Dec 12, 2022

  1. Use platform-specific read_at to read the files.

    All frfs::File uses the same source underneath. The sources are created
    with try_clone. Therefore when one file is readed, all other files'
    cursor will be changed. This is not a desirable behavior.
    
    While there are no cross-platform way to avoid this besides reopening
    the source, we can use read_at/seek_read methods in the FileExt. It is a
    platform-specific extension, but avaliable on Windows, Unix, and WASI.
    
    The implementation on Unix of read_at is pread/pread64, and the one on
    Windows is NtReadFile. They are all reliable methods and will not read
    or write the file cursor.
    
    Using read_at, we need to manage the own offset in the frfs::File.
    
    This implementation is not suitable for try_clone. Therefore we removed
    this method.
    Berrysoft committed Dec 12, 2022
    Configuration menu
    Copy the full SHA
    2a6824a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d2bfee8 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2022

  1. Add comments for seek_read.

    Berrysoft committed Dec 16, 2022
    Configuration menu
    Copy the full SHA
    b79cc81 View commit details
    Browse the repository at this point in the history
  2. Add msrv.

    Berrysoft committed Dec 16, 2022
    Configuration menu
    Copy the full SHA
    c8211f6 View commit details
    Browse the repository at this point in the history