tar and the semantics of "filenames"

Michael S. Zick mszick at morethan.org
Wed Apr 19 14:01:04 UTC 2006


On Wed April 19 2006 06:10, Robert P. J. Day wrote:
> 
> 
>   the format of that internal filename depends on how *exactly* you
> create the tarball.  there's a difference between:
> 
>   $ tar cf r.tar r.tif
>   $ tar cf r.tar ./r.tif
> 
> in the second case, the internal filename will start with that "./"
> prefix.  so what should happen there?  when you use GNU tar for
> explicit extraction, it *requires* you to add that prefix if that's
> how the tarball was created.
> 
>   $ tar xf r.tar r.tif
>   tar: r.tif: Not found in archive
>   tar: Error exit delayed from previous errors
>   $ tar xf r.tar ./r.tif 	(OK)
>   $
> 
> in any event, time to think about how to resolve this stuff?
> 
Perhaps at the script level by the user?

I.E:
 ~$ tar cf e.tar --label "With prefix ./" ./enable.txt

 ~$ tar --list --file=e.tar
With prefix ./
./enable.txt

Mike (one of them)



More information about the busybox mailing list