Skip to content

fix(mem): implement io.ReaderFrom on MemMapFs files#604

Open
leno23 wants to merge 1 commit into
spf13:masterfrom
leno23:fix/mem-file-readfrom-498
Open

fix(mem): implement io.ReaderFrom on MemMapFs files#604
leno23 wants to merge 1 commit into
spf13:masterfrom
leno23:fix/mem-file-readfrom-498

Conversation

@leno23

@leno23 leno23 commented May 17, 2026

Copy link
Copy Markdown

Summary

  • Implements io.ReaderFrom on mem.File so MemMapFs files behave like *os.File for io.Copy fast paths.
  • ReadFrom writes starting at the current file offset and advances it, matching os.File semantics.
  • Adds unit tests in mem and integration tests for MemMapFs.

Fixes #498

Test plan

  • go test ./...

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

MemMapFs files now support ReadFrom so io.Copy can use the fast path,
matching os.File behavior requested in spf13#498.
@leno23 leno23 force-pushed the fix/mem-file-readfrom-498 branch from d985e2e to 3b61445 Compare May 17, 2026 15:50
@spf13

spf13 commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Thanks for these contributions. Before we can review and merge, you'll need to sign the Contributor License Agreement (CLA). Please do so and then let us know — we'll pick up the review from there.

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.

Support for afero.File.ReadFrom (to implement io.ReaderFrom)

3 participants