FILE="/Users/magregor/src/imgunbundle/test/test_data/isolinux/initrd.gz"
import sys, os
import pprint
import libarchive.public as la
with open(FILE, 'rb') as fh:
with la.file_reader(fh.name) as lafh:
count = 0
for count,entry in enumerate(lafh):
print str(entry)
#print entry.filetype
pprint.pprint(dir(entry.filetype))
if not count:
outfile = os.path.splitext(os.path.basename(FILE))[0]
for entry in la.file_pour(FILE):
print(entry)
print(outfile)
raise Exception('No count')
result:
Traceback (most recent call last):
File "/Users/magregor/tmp/test_lafh.py", line 18, in <module>
raise Exception('No count')
Exception: No count
test code:
result: