Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: path in tar file...please help

by philcrow (Priest)
on Oct 10, 2007 at 21:04 UTC ( #644092=note: print w/ replies, xml ) Need Help??


in reply to path in tar file...please help

Can you have the script chdir $UploadDir prior to issuing the shell out to tar? Then omit the repeated use of $UploadDir from the command:

my $cmd = 'tar -cvf results.tar en_ran.out...'; chdir $UploadDir; my $result = `$cmd`;
Otherwise, you'll need to closely read the man page for your tar command to see if there is a flag in your version to strip path elements either on the way into or out of the tar. GNU tar (in some versions) has --strip-components NUMBER, others have --strip-path NUMBER, these can remove path elements during extraction.

Phil

The Gantry Web Framework Book is now available.


Comment on Re: path in tar file...please help
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2015-07-31 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (275 votes), past polls