tags:

views:

34

answers:

1

I use python tarfile module.
I have a system backup in tar.gz file.
I need to get first level dirs and files list without getting ALL the list of files in the archive because it's TOO LONG.
For example: I need to get ['bin/', 'etc/', ... 'var/'] and that's all.
How can I do it? May be not even with a tar-file? Then how?

+1  A: 

You can't scan the contents of a tar without scanning the entire file; it has no central index. You need something like a ZIP.

Glenn Maynard