473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Unpack to a specific directory

Nepomuk
3,112 Expert 2GB
Hi!
I'm trying to unpack a tar.gz file to a certain directory. I'm using
Expand|Select|Wrap|Line Numbers
  1. gunzip -N < source | tar xvf - 
  2.  
so far. (Yes, I know there is a shorter form, but I can't use that for certain reasons.)

What I want is to give the target directory for everything, that's unpacked.

I've checked man tar and I tried adding > target without any success. How can I achieve this? Do I have to pipe it to mv?

Greetings,
Nepomuk
Sep 21 '07 #1
3 5882
Have you tried appending "-C /target/directory" to tar's options?
Sep 21 '07 #2
Nepomuk
3,112 Expert 2GB
Have you tried appending "-C /target/directory" to tar's options?
Neither tar nor gzip seems to have the "C" argument. It tells me:
Expand|Select|Wrap|Line Numbers
  1. tar: You must specify one of the `-Acdtrux' options
  2. ...
  3. gunzip: stdout: Broken pipe
  4.  
I'd be thankful for any help.

Greetings,
Nepomuk
Sep 24 '07 #3
Nepomuk
3,112 Expert 2GB
I've found a solution, however not exactly what I was looking for and in my opinion the solution isn't that great.

What I do is, I change my current directory to the target directory and untar my file with an absolute path.

If anyone finds a way to unpack it into a different directory directly, that would be awesome.

Greetings,
Nepomuk
Sep 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chuck Amadi | last post by:
Im running $ python email-unpack.py -d /home/chuck/surveyResults What parameters do I use I have tried substituting msgfile fp = open(msgfile) for my given path (/home/chuck/Mail/Inobx) still no...
5
by: Geoffrey | last post by:
Hope someone can help. I am trying to read data from a file binary file and then unpack the data into python variables. Some of the data is store like this; xbuffer:...
5
by: grant | last post by:
Hi All, I am pretty new to python and am having a problem intepreting binary data using struct.unpack. I am reading a file containing binary packed data using open with "rb". All the values are...
3
by: Andrew Robert | last post by:
Hey everyone, Maybe you can see something I don't. I need to convert a working piece of perl code to python. The perl code is: sub ParseTrig {
4
by: OhKyu Yoon | last post by:
Hi! I have a really long binary file that I want to read. The way I am doing it now is: for i in xrange(N): # N is about 10,000,000 time = struct.unpack('=HHHH', infile.read(8)) # do...
2
by: brnstrmrs | last post by:
If I run: testValue = '\x02\x00' junk = struct.unpack('h', testValue) Everything works but If I run testValue = raw_input("Enter Binary Code..:") inputting at the console '\x02\x00' junk...
0
by: Ping Zhao | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I am writing a small program to decode MS bitmap image. When I use statements as follow, it works fine: header = str(struct.unpack('2s',...
17
by: JRough | last post by:
I have used this function to create a string called $headers: function GetHeaders($file_name){ return "<th><a href='".$file_name."&order_by=l_e'>L_E</a></th> <th><a...
19
by: JRough | last post by:
I have used this function to create a string called $headers: function GetHeaders($file_name){ return "<th><a href='".$file_name."&order_by=l_e'>L_E</a></th> <th><a href='"....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.