proposal: os: support copy_file_range for SectionReader #73399
Labels
LibraryProposal
Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool
Proposal
Milestone
Proposal Details
Writing to a file from an
io.SectionReader
backed by a file coulduse
copy_file_range(2)
.The machinery for this mostly exists:
SectionReader.Outer()
givesaccess to the underlying
*os.File
and offset. Then, the offsetshould be passed into
unix.CopyFileRange
. After the call completes,the number of bytes (or the updated offset) can be passed to
SectionReader.Seek
.The only missing piece is that
CopyFileRange
ininternal/poll
does not accept offset arguments. Is this something that can be
changed, and if yes, does it require a formal proposal?
For reference, this is similar to
#61727.
The text was updated successfully, but these errors were encountered: