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

proposal: x/exp/mmap: expose a File-like type #39683

Open
sbinet opened this issue Jun 18, 2020 · 2 comments
Open

proposal: x/exp/mmap: expose a File-like type #39683

sbinet opened this issue Jun 18, 2020 · 2 comments
Labels
Milestone

Comments

@sbinet
Copy link
Member

@sbinet sbinet commented Jun 18, 2020

right now, with the current mmap.ReaderAt type, one can easily (and from multiple goroutines) access mmap'ed data.

that's great.

but my application A also needs an io.Reader.
I've resorted to forking the x/exp/mmap package under go-mmap/mmap, that exposes a Reader type that implements io.Reader, io.Seeker, io.ReaderAt and io.ByteReader.

now, in yet another application (B), to interface with a FPGA board, I'd also need write access.

it comes to reason to thus expose a File-like type, implementing also io.Writer, io.WriterAt and io.ByteWriter.

@gopherbot gopherbot added this to the Unreleased milestone Jun 18, 2020
@andybons andybons changed the title x/exp/mmap: expose a File-like type proposal: x/exp/mmap: expose a File-like type Jun 18, 2020
@gopherbot gopherbot added the Proposal label Jun 18, 2020
@bcmills
Copy link
Member

@bcmills bcmills commented Jun 18, 2020

Is there a reason you can't (or shouldn't) wrap it in an io.SectionReader?

@sbinet
Copy link
Member Author

@sbinet sbinet commented Jun 18, 2020

no, I just didn't think about io.SectionReader (which is sad b/c I do use it quite extensively in other parts of "application A")

but for "application B", I would need r/w capabilities (to interact with a Cyclone V FPGA board)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.