fivemack: (Default)
[personal profile] fivemack
Is there some series of command-line options to 'tar' which lets me create a tar file which contains the file called (with respect to the current directory) X/Y/Z/foo.baz but in such a way that, when my end-user unpacks the tar file, it comes out as R/S/bar.quux ?

It seems a natural thing for anyone doing packaging to want to do; the GNU info page for tar appears to be a dreadful combination of inadequate tutorial and inadequate reference manual, and I've been unable to figure out what to do merely by reading it.
(deleted comment)

Date: 2006-11-06 05:32 pm (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
Hard linking is probably overkill; my usual approach is to symlink and use tar -h. Of course this fails if you also wanted your tar file to contain some real symlinks, at which point you probably do need to fall back to hard links or LD_PRELOAD or other diverse evils; but it works for my usual purposes at least.

Date: 2006-11-06 03:40 pm (UTC)
redbird: closeup of me drinking tea, in a friend's kitchen (Default)
From: [personal profile] redbird
I think [livejournal.com profile] met24 is right; you could throw together a script to create the links and then run 'tar'.

Date: 2006-11-06 04:30 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
Things like libtricks (which used LD_PRELOAD to mess with a dynamically linked program's view of the world) might be able to help, but Martin's suggestion is the simplest approach.

March 2024

S M T W T F S
     12
3456789
10111213141516
17181920212223
24 252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 9th, 2026 12:58 pm
Powered by Dreamwidth Studios