Skip to content

proposal: archive/tar: add Reader FS() #74041

Closed as duplicate of#61232
Closed as duplicate of#61232
@champtar

Description

@champtar

Proposal Details

tar archive are not indexed, but if our input implement io.ReaderAt, we can do a first scan pass (seeking over the data parts) and build a fs.FS(), then users can access random files in the archive without having to extract the archive

A use case I have in mind is the oci-archive format that uses uncompressed tar archive (the blobs inside the archive are compressed), today all operations require the archive to be extracted first containers/image#2869

There is an existing implementation already https://github.com/nlepage/go-tarfs, but it really on the current code behavior to work (https://github.com/nlepage/go-tarfs/blob/7b1a8fac13d9033f2b1fdad64486c19ad8803cb2/fs.go#L70).

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolProposal

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions