bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Parsing the output of `tar tvf'


From: Helmut Waitzmann
Subject: Re: [Bug-tar] Parsing the output of `tar tvf'
Date: Thu, 12 Jan 2006 06:53:18 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

"Otto Maddox" <address@hidden> writes:

>I'm trying to write a wrapper around GNU Tar which determines the
>stored permissions, owner, group and name of each file in the archive.

>Does anyone know of any tools, or have any hints, for listing the
>contents of the archive in a more easily parsable way?  I've read
>about file formats in chapter 8 of the Tar manual, but I don't really
>want to write a C program, if I can avoid it.

There is no C or whatever program, which could be written to parse the
output of

$ tar -tvf

Look at this example.  Execute it in an empty directory:

$ ln -s -- link 'file ->' && ln -s -- '-> link' file && \
  tar -c -f - . | LC_ALL=C tar -tvf -
drwx------ helmut/helmut   0 2006-01-12 06:30:47 ./
lrwxrwxrwx helmut/helmut   0 2006-01-12 06:30:31 ./file -> -> link
lrwxrwxrwx helmut/helmut   0 2006-01-12 06:30:47 ./file -> -> link

As you can see, one cannot distinguish the two symlinks 'file ->' and
'file'.  Sorry.  tar -tvf is broken by design.

So you can't help looking into the tape archive yourself.  Tar -tvf does
not do its job.

Helmut
-- 
Wenn Sie mir E-Mail schreiben, stellen |  When writing me e-mail, please
Sie bitte vor meine E-Mail-Adresse     |  precede my e-mail address with
meinen Vor- und Nachnamen, etwa so:    |  my full name, like
Helmut Waitzmann <address@hidden>, (Helmut Waitzmann) address@hidden





reply via email to

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