August 10th, 2012, 04:59 AM
Extract file.tar.gz to filesystem - not memory
I have a large "tar.gz" file (1GB+) that needs decompressing from within a python script.
At the moment I just
However, that does not catch errors - I found lots of ways to decompress a file and load it into memory - however, I don't want 1GB+ in memory, I want to decompress it directly to disk?
os.system("tar zxvf file.tar.gz")
Would someone be so kind as to point me in the right direction?
August 10th, 2012, 10:30 AM
You could try the command
gunzip file.tar.gz && tar xpvf file.tar
I won't assure you that separating the commands this way will use less memory but it seems like it might.
[/code] are essential for python code and Makefiles!