bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] fast extract of single file from large tar.gz archive


From: Pavel Raiskup
Subject: Re: [Bug-tar] fast extract of single file from large tar.gz archive
Date: Fri, 15 Aug 2014 00:09:54 +0200
User-agent: KMail/4.13.3 (Linux/3.15.8-200.fc20.x86_64; KDE/4.13.3; x86_64; ; )

On Thursday 14 of August 2014 08:47:15 Tim Kientzle wrote:
> 
> On Aug 13, 2014, at 10:39 PM, Dilip Chhetri <address@hidden> wrote:
> 
> > I have lots of large .tar.gz files and I need to extract just a single 
> > (small) file from it. I purposely put it at the front of .tar file so that 
> > extraction is fast, but if that file is gzipped, then 'tar' wants to read 
> > the whole .tgz file before exiting.
> ...
> > Q: is there any special option to make it fast. If not this would be really 
> > good enhancement (I saw lot of people asking for it on the web). If someone 
> > can post a patch to fix this behaviour, that would be really nice. I spent 
> > sometime reading source code for tar, but things aren't looking obvious to 
> > me.
> 
> GNU tar relies on a separate program to decompress
> input files and needs to allow that program to finish in
> order to avoid problems in various boundary cases.  In
> effect, this means that GNU tar does in fact always
> decompress the entire file.  This is unlikely to change,
> as a lot of people depend on the current behavior.

I'm just curious, what people depend on with this regard?  They require
the whole file is read?
We could hide the optimization behind new option, possibly.  The problem
what can happen is that one tar file may have multiple files of the same
name (so one expectation would be to read/extract only the first
occurrence).

Pavel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]