Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Walk over nested Archives #164

@alixaxel

Description

@alixaxel

What would you like to have changed?

I'd like to have the ability to Walk over io.ReadClosers and not just file paths.

Why is this feature a useful, necessary, and/or important addition to this project?

Although I understand this is somewhat of a niche need, it's conceivable that a ZIP file could contain more ZIP files nested within it. By providing a such a method, it would be possible to inspect the contents of the inner ZIP/Tar/Rar, something along the lines of:

err := archiver.Walk(path, func(file archiver.File) error {
  if (filepath.Ext(file.Name()) == ".zip") {
    err := archiver.WalkDeep(file.ReadCloser, func(file archiver.File) error {
      return nil
    })
  } else {
    // non-archive file
  }

  return nil
}

I think (but might be wrong) it's not possible to read just the inner ZIP EOCD and correctly map each entry to the correct byte offsets (due to the potential several layers of compression).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions