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

plan9/client: make ReadAt compatible with io.ReaderAt interface #26

Merged
merged 1 commit into from
Apr 16, 2021

Conversation

fhs
Copy link
Contributor

@fhs fhs commented Aug 29, 2018

Satisfy this requirement of io.ReaderAt:

When ReadAt returns n < len(p), it returns a non-nil error
explaining why more bytes were not returned.

In other words, when EOF is reached and 0 < n < len(p), io.EOF error
must be returned. ReadAt was delaying sending io.EOF until n == 0.

Satisfying io.ReaderAt makes it possible to substitute Fid with os.File
in Plan 9.

Satisfy this requirement of io.ReaderAt:

    When ReadAt returns n < len(p), it returns a non-nil error
    explaining why more bytes were not returned.

In other words, when EOF is reached and 0 < n < len(p), io.EOF error
must be returned. ReadAt was delaying sending io.EOF until n == 0.

Satisfying io.ReaderAt makes it possible to substitute Fid with os.File
in Plan 9.
fhs added a commit to fhs/9fans-go that referenced this pull request Oct 9, 2018
Depends on PR 9fans#26 for consistent behavior of ReadAt.

Helps rjkroege/edwood#115
@fhs fhs mentioned this pull request Oct 9, 2018
fhs added a commit to fhs/9fans-go that referenced this pull request Sep 19, 2019
Depends on PR 9fans#26 for consistent behavior of ReadAt.

Helps rjkroege/edwood#115
ddevault pushed a commit to ddevault/9fans-go that referenced this pull request Sep 21, 2019
Depends on PR 9fans#26 for consistent behavior of ReadAt.

Helps rjkroege/edwood#115
fhs added a commit to fhs/9fans-go that referenced this pull request May 12, 2020
Depends on PR 9fans#26 for consistent behavior of ReadAt.

Helps rjkroege/edwood#115
@rsc rsc merged commit 1bbb173 into 9fans:main Apr 16, 2021
@fhs fhs deleted the readat branch April 16, 2021 23:13
anton2920 pushed a commit to anton2920/9fans-go that referenced this pull request Apr 25, 2023
Depends on PR 9fans#26 for consistent behavior of ReadAt.

Helps rjkroege/edwood#115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants