[Tutor] .tar.gz in Py (was: do pythons like coffee?)

Andrei project5 at redrival.net
Sat Jan 31 16:29:18 EST 2004


Hi,

I have a batch file in which I create a tar.gz file of a directory
containing nested subdirectories (and files) using the 7-zip command line,
like this:

7z.exe a -ttar ..\myfile.tar * -r
cd..
7z.exe a -tgzip myfile.tar.gz myfile.tar -r

The result then looks somewhat like this:

  - myfile.tar.gz
       |
       |- myfile.tar
             |
             |- file1.ext
             |- dir1
                   |
                   |-file2.ext

Python has a tarfile module so I was thinking I'd like to migrate that to
Python (not just by running os.system()) because I use it in building a
distro for a program. The problem is that the docs for the tarfile module
don't seem to fit my brain and I also can't find any decent sample code. 
Does anyone know any examples for using the tarfile module?

-- 
Yours,

Andrei

=====
Mail address in header catches spam. Real contact info (decode with rot13):
cebwrpg5 at jnanqbb.ay. Fcnz-serr! Cyrnfr qb abg hfr va choyvp cbfgf. V ernq
gur yvfg, fb gurer'f ab arrq gb PP.




More information about the Tutor mailing list