473,396 Members | 2,129 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,396 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 5883
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.