PyEasyArchive icon indicating copy to clipboard operation
PyEasyArchive copied to clipboard

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

Open stuaxo opened this issue 9 years ago • 1 comments

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

stuaxo avatar Jan 02 '17 22:01 stuaxo

    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.')

SkyLeach avatar Jan 26 '17 19:01 SkyLeach