Re: Extract file from tar home/

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

 



On Tue, 2010-06-08 at 21:55 -0500, Robert Nichols wrote:
> There is no way other than linear search to find a file in a tar
> archive, so tar always has to read** from the beginning of the archive
> until it comes to a file you want.

IIRC for uncompressed tarballs this is not strictly the case. The layout
is basically metadata-file-metadata-file-... so it's possible to seek
over intermediate files in strides (as the metadata includes the file
size). For compressed tarballs of course this won't work, which is what
I was trying to say.

> Even after it has extracted everything you
> asked for, tar will continue to the end of the archive looking for a
> possible later version of one of the files you wanted, appended with a
> --concatenate operation after the original archive was created.

A good point which I hadn't considered.

> And, while tar can't append to a compressed archive, it's entirely
> possible that the archive was compressed by a separate gzip operation
> after the appending was done.

Indeed. However the net effect is that although tar has to do the work
in terms of cpu, it doesn't have to store the uncompressed version of
the tarball anywhere, so it's still a win over uncompressing and then
untarring.

poc

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux