delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/03/19/15:05:37

Date: Mon, 19 Mar 2001 22:02:33 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Juan Manuel Guerrero" <ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De>
Message-Id: <2110-Mon19Mar2001220233+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
CC: djgpp-workers AT delorie DOT com
In-reply-to: <50F387E4047@HRZ1.hrz.tu-darmstadt.de>
(ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De)
Subject: Re: Small bugfix for tar-1.12a
References: <50F387E4047 AT HRZ1 DOT hrz DOT tu-darmstadt DOT de>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Juan Manuel Guerrero" <ST001906 AT HRZ1 DOT HRZ DOT TU-Darmstadt DOT De>
> Organization: Darmstadt University of Technology
> Date: Mon, 19 Mar 2001 16:32:04 +0200
> 
> I do not know if this is already known but
> if tar is invoked as:
>   tar -cvf foobar.tar --name-prefix=c:/foo/  z:/bar
> both path strings, c:/foo and z:/bar will be concatenated
> together like this:
>   foo/z:/bar
> instead of:
>   foo/bar
> as it should be.

Why?  --name-prefix tells Tar simply to prepend an arbitrary string to
the names.  It is not up to Tar to decide what string can be prepended
and what cannot, or second-guess what the user meant.  It should
simply do-what-I-tell-it and shut up ;-)

What happens on Unix if you say "--name-prefix=/foo//// /bar"?  Does
Tar remove the extra slashes or simply concatenates the strings?

> From both path strings, the drive spec
> and the leading slash should be removed before concatenating
> them . If no name-prefix is given at all the drive spec and
> first slash will be removed from
>   z:/bar
> in the correct way.

Does Tar on Unix remove the leading slash in the above example?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019