Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Archive:Tar appears to store absolute pathnames as relative pathnames

by Fox (Pilgrim)
on Dec 11, 2009 at 13:21 UTC ( #812372=note: print w/ replies, xml ) Need Help??


in reply to Archive:Tar appears to store absolute pathnames as relative pathnames

yea this is what also tar does.
i.e. if you compress /home/users/you/dir/
you will have home/users/you/dir

unpacking it to / is the receiver choice. you can't force him to unpack on /

UPDATE: ok, it looks like you can, on tar you must use -P, and it won't unpack to / if you don't also use -P when unpack


Comment on Re: Archive:Tar appears to store absolute pathnames as relative pathnames
Select or Download Code
Re^2: Archive:Tar appears to store absolute pathnames as relative pathnames
by Bloodnok (Vicar) on Dec 11, 2009 at 13:30 UTC
        ...if you compress /home/users/you/dir/ you will have home/users/you/dir

    Obviously it's a feature of the compression that I'd not noticed 'til now - a gotcha I'll be sure to remember from here on in...

    <c> ...you can't force him to unpack on /

    ..which, IMO, just goes to show that the use of compressed tar(1) files is not the way to go from the POV of software delivery where delivery of absolute files is frequently an immutable requirement.

    A user level that continues to overstate my experience :-))
Re^2: Archive:Tar appears to store absolute pathnames as relative pathnames
by Anonymous Monk on Apr 20, 2011 at 14:05 UTC
    You can also compress using the -C option, to change to that directory, and then you will have relatives paths. for example: /home/users/you/dir I can compress using: tar -czf example.tar.gz -C /home/users/you dir And you will get a tar with the directory dir.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://812372]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-12-22 05:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (110 votes), past polls