bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Directories are listed like files, no trailing slash shown


From: Joerg Schilling
Subject: Re: [Bug-tar] Directories are listed like files, no trailing slash shown
Date: Mon, 5 Nov 2012 11:03:30 +0100
User-agent: nail 11.22 3/20/05

Live user <address@hidden> wrote:

> Either using
>
> tar -tf archive.tar
>
> OR
>
> tar --list -f archive.tar
>
> Doesn't show the trailing slash that corresponds to a dir, making 
> impossible to know if the content is a directory or a file without 
> having to use verbose output.
>
>
> Example: get the contents of a tar archive to a text file:
>
> tar --list -f myarchive.tar
> dir1
> dir1/data.dat
>
> Where it should be
>
> dir1/
> dir1/data.dat

No, whether or not a directory is listed with a traling slash depends on the 
file name in the archive. As the original tar (note that I am talking about tar 
and not gtar) from 1977 did not support directories, BSD coded them as files 
with a trailing slash.

POSIX.1-1988 then introduced a directory type flag and if this is used, the 
trailing slash is not needed.

If you like to distinct between directories and other files, I recommend to use 
star and it's build in find(1).

        star -t < filename -find -type d

lists only directories.

Jörg

-- 
 EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
       address@hidden                (uni)  
       address@hidden (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily



reply via email to

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