Skip to content

Function to return reader of nested member #119

Description

@bruth

Hi! I am looking to implement a function that would ideally leverage the recursive unpacking and decompression this package already does. The function signature would look something like this:

func ReadMember(path string, member string) (io.ReadCloser, error)

Where path would be the path to the source file and member would be the name of the member within the file whose byte stream will be returned in the io.ReadCloser. For now, member would be the filename returned by Siegfried that delimits paths by # when denoting nested files.

For example, given a (contrived) archive:

foo.zip
    dir/bar.zip
        baz.csv.gz

Calling ReadMember("foo.zip", "foo.zip#dir/bar.zip#baz.csv.gz#baz.csv") would return a io.ReadCloser that would be the decompressed contents of baz.csv.

The use case is to dynamically read out portions of an archive given the semantics of Siegfried.

A more general function that would walk the members of an input, but that would need to be limited to leaves in the hierarchy.

Do you have a suggestion on how to implement this given the components available in this package?

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