Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to access files inside an archive nested inside another archive ? #18

Open
stuaxo opened this issue Jan 2, 2017 · 1 comment

Comments

@stuaxo
Copy link

stuaxo commented Jan 2, 2017

E.G. - A zip file containing many 7zips, that themselves have files inside ?

@SkyLeach
Copy link

    data = [block for block in entry.blocks]
    for entry2 in  libarchive.public.memory_pour(data):
        if entry2.filetype.IFDIR or dest[-1] == os.path.sep:
            if not os.path.exists(dest):
                os.makedirs(dest)
        else:
            try:
                with open(dest, 'wb') as f:
                    try:
                        for block in entry2.get_blocks():
                            f.write(block)
                    except ValueError:
                        # TODO: add further test when PyEasyArchive is patched
                        _logger.warn('Probable password encrypted file.')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants