Pipelining tar create and tar extract the "Python" way...

Ishwor Gurung ishwor.gurung at gmail.com
Fri Sep 25 12:33:04 EDT 2009


Ray.
Hi
>> >   tar cvf - SrcDir | (cd /dest ; tar xvf -)

Check this out Ray if you haven't done it already
http://docs.python.org/library/tarfile.html
"
The tarfile module makes it possible to __read__ and write tar
archives, including those using gzip or bz2 compression.
"
Try breaking it up the functionality.
That's how shell achieves this functionality as whole, why wouldn't
you apply same technique in Python :-)

Some modules that could help for your specific situations are tarfile and os.

Popen is one way(It's what your spec says) but you'd want to do purely
in Python. Aren't you curious? :-) It's late and TGIF! Need sleep.
Goodluck.

-- 
Regards,
Ishwor Gurung



More information about the Python-list mailing list