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?
views:
34answers:
1
+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
2010-08-07 20:25:43