compression level with tarfile (w:gz) ?

2009-08-10 Thread Esmail
Hello, I was wondering if it possible to specify a compression level when I tar/gzip a file in Python using the tarfile module. I would like to specify the highest (9) compression level for gzip. Ideally: t = tarfile.open(tar_file_name+'.tar.gz', mode='w:gz:9') When I create a simple tar

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Benjamin Kaplan
On Mon, Aug 10, 2009 at 8:50 AM, Esmailebo...@hotmail.com wrote: Hello, I was wondering if it possible to specify a compression level when I tar/gzip a file in Python using the tarfile module. I would like to specify the highest (9) compression level for gzip. Ideally:   t =

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Esmail
Benjamin Kaplan wrote: On Mon, Aug 10, 2009 at 8:50 AM, Esmailebo...@hotmail.com wrote: I was wondering if it possible to specify a compression level when I tar/gzip a file in Python using the tarfile module. I would like to specify the highest (9) compression level for gzip. Ideally: t =

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Benjamin Kaplan
On Mon, Aug 10, 2009 at 9:37 AM, Esmailebo...@hotmail.com wrote: Benjamin Kaplan wrote: On Mon, Aug 10, 2009 at 8:50 AM, Esmailebo...@hotmail.com wrote: I was wondering if it possible to specify a compression level when I tar/gzip a file in Python using the tarfile module. I would like to

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Lars Gustäbel
On Mon, Aug 10, 2009 at 08:50:21AM -0400, Esmail wrote: I was wondering if it possible to specify a compression level when I tar/gzip a file in Python using the tarfile module. I would like to specify the highest (9) compression level for gzip. tarfile uses gzip.GzipFile() internally,

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Esmail
Benjamin Kaplan wrote: I can't find tarfile.gzopen in the tarfile docs, I'm looking here: http://docs.python.org/library/tarfile.html Am I looking at the wrong page? My mistake. It isn't a function of the tarfile module, it's a class method of tarfile.TarFile. I was looking at the

Re: compression level with tarfile (w:gz) ?

2009-08-10 Thread Esmail
Hi Lars, Lars Gustäbel wrote: How much smaller is it? I did a test with a recent Linux kernel source tree which made an archive of 337MB. Command-line gzip was ahead of Python's GzipFile() by just 20200 bytes(!) with an archive of about 74MB. Is the only way to accomplish the higher rate to