"tar t" and aesthetics -- the fundamental problem

Robert P. J. Day rpjday at mindspring.com
Wed Apr 19 00:09:48 UTC 2006


On Wed, 19 Apr 2006, Natanael Copa wrote:

> (i did it again... forgot to cc the list on the previous mail I sent.
> anyway. it was about that freebsd is doing what rday proposed. sorry.)
>
> Robert P. J. Day wrote:
> > On Wed, 19 Apr 2006, Natanael Copa wrote:
> >
> >> ... So I dig into the busybox code, where I find this around line
> >> 197 in get_header_tar.c:
> >>
> >>         {       /* Strip trailing '/' in directories */
> >>                 /* Must be done after mode is set as '/' is used to
> >> check if its a directory */
> >>                 char *tmp = last_char_is(file_header->name, '/');
> >>                 if (tmp) {
> >>                         *tmp = '\0';
> >>                 }
> >>         }
> >
> > ok, that just makes me want to drink heavily.  the code uses the
> > *trailing slash* to determine if the object is a directory?!?!  that
> > is *so* not the way i think it should be done.
>
> ------------------------------------------------------------------------
> r7453 | bug1 | 2003-09-09 19:41:03 +0200 (Tue, 09 Sep 2003) | 11 lines
>
> If a tar entry is a regualr file ending in a '/' then its really a
> directory.
> >From http://www.gnu.org/manual/tar/html_node/tar_123.html
> REGTYPE
> AREGTYPE
>     These flags represent a regular file. In order to be compatible with
> older versions of tar, a typeflag value of AREGTYPE should be silently
> recognized as a regular file. New archives should be created using
> REGTYPE. Also, for backward compatibility, tar treats a regular file
> whose name ends with a slash as a directory.

you're right, i posted too soon without thinking about it.  argh.  i
was thinking about stuff like "stat()" without realizing that we were
talking about a tar *listing*.  my apologies.

i'll give this more thought before i post something silly again.

rday



More information about the busybox mailing list