Skip to content

Consider providing an io.SectionReader interface to ar content #114

@charles-dyfis-net

Description

@charles-dyfis-net

At present, archive members can only be read in order: continuing to the next one consumes all data from the existing LimitedReader.

This makes it somewhat more difficult than it would otherwise be to check debsig-style signatures (for which an io.MultiReader(controlReader, dataReader) would otherwise be the perfect thing to pass to openpgp.CheckDetachedSignature) without (necessarily and unambiguously) copying everything into RAM.

At the expense of requiring a seekable file handle on the underlying file, one could switch from a LimitedReader interface to a SectionReader, to make reads still possible after ar.Next() has been called.

See blakesmith/ar#11 for a concrete idea of what's being proposed. (I'd be happy to provide a concrete implementation here as well should it be welcome; implemented above on top of blakesmith/ar before discovering that go-debian existed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions