Tar and absolute pathnames

John Gilmore gnu at hoptoad.uucp
Tue Feb 2 12:35:00 AEST 1988


In article <2561 at encore.UUCP> adamm at encore.UUCP (Adam S. Moskowitz) writes:
>Some time back, ted at braggvax posted a query about 4.3BSD tar & absolute path
>names.  Did this issue ever get resolved (other than by telling Ted he was a
>fool for using absolute pathnames)?

I never saw the query, but can maybe provide some info.  Absolute pathnames
worked OK on the 4.2 tar we used at Sun.  The bad part was that I would
occasionally receive tapes written by amateurs, which had absolute path
names.  This made it hard to extract them into, say, my home directory.

My PD tar (in the comp.sources.unix archives) automatically strips off
a leading "/", both when creating a tape and when extracting one.  In both
cases it warns you about it.  Recently I got a request from David Vezie
at r2d2, mentioning that to move things from machine to machine he often
does:

	tar cf - /path/path/dir | rsh machine tar xvpf -

but if "rsh" won't put him in the root directory, with pdtar he has to:

	tar cf - /path/path/dir | rsh machine 'cd / ; tar xvpf -'

This is the only half-reasonable use of absolute pathnames in tar that
I've ever seen.  I advised him to make a shell script that just does
the second form, since it works with both tars.
-- 
{pyramid,ptsfa,amdahl,sun,ihnp4}!hoptoad!gnu			  gnu at toad.com
		"Watch me change my world..." -- Liquid Theatre



More information about the Comp.bugs.4bsd.ucb-fixes mailing list