473,388 Members | 1,355 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,388 software developers and data experts.

unpack gzipped tar archive

I get a gzipped tar archive e-mailed to me every day. Thanks to help from
this newsgroup I have a daily c# program that scans my outlook mail, finds
the archive and saves it to a file.

Now I'd like to unpack it, Ã* lÃ* (cd targetdir; gunzip file|tar xvf -)
How do I do this from the same c# program?

Thanks for ideas & insight,
Eric
Jul 21 '05 #1
4 2354
Eric Nelson <Er********@discussions.microsoft.com> wrote:
I get a gzipped tar archive e-mailed to me every day. Thanks to help from
this newsgroup I have a daily c# program that scans my outlook mail, finds
the archive and saves it to a file.

Now I'd like to unpack it, ? l? (cd targetdir; gunzip file|tar xvf -)
How do I do this from the same c# program?


You could use SharpZipLib:
http://www.icsharpcode.net/OpenSourc...b/Default.aspx

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
Hi Jon,
Wow that was quick (10 min from post to reply)

I saw the SharpZipLib reference (in the intervening 10min) while reading the
FAQ you mentioned to someone else. I didn't realize it was free so I didn't
look at it.

But... isn't there a way to just say gzip|tar? For example, I also noticed
Process.Start which must be .net's way of saying system(...).

Thanks,
Eric

"Jon Skeet [C# MVP]" wrote:
Eric Nelson <Er********@discussions.microsoft.com> wrote:
I get a gzipped tar archive e-mailed to me every day. Thanks to help from
this newsgroup I have a daily c# program that scans my outlook mail, finds
the archive and saves it to a file.

Now I'd like to unpack it, ? l? (cd targetdir; gunzip file|tar xvf -)
How do I do this from the same c# program?


You could use SharpZipLib:
http://www.icsharpcode.net/OpenSourc...b/Default.aspx

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #3
Wow, Jon, that was quick... 10min from post to reply!

I saw SharpZipLib in the FAQ you mentioned in another post. I didn't realize
it was free so I didn't look further.

But... I already have gnu tools so it would be really easy to just use the
unix idiom below. Can I do it with .net? In the same FAQ Process.Start is
listed... that the way to do it?

Thanks,
Eric

"Jon Skeet [C# MVP]" wrote:
Eric Nelson <Er********@discussions.microsoft.com> wrote:
I get a gzipped tar archive e-mailed to me every day. Thanks to help from
this newsgroup I have a daily c# program that scans my outlook mail, finds
the archive and saves it to a file.

Now I'd like to unpack it, ? l? (cd targetdir; gunzip file|tar xvf -)
How do I do this from the same c# program?


You could use SharpZipLib:
http://www.icsharpcode.net/OpenSourc...b/Default.aspx

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #4
Eric Nelson <Er********@discussions.microsoft.com> wrote:
Wow that was quick (10 min from post to reply)

I saw the SharpZipLib reference (in the intervening 10min) while reading the
FAQ you mentioned to someone else. I didn't realize it was free so I didn't
look at it.

But... isn't there a way to just say gzip|tar? For example, I also noticed
Process.Start which must be .net's way of saying system(...).


There are some differences between system() and Process.Start, I
believe, in terms of shell functions and paths, but I haven't looked in
detail.

You'd have to build the functionality you want from SharpZipLib rather
than it coming prepackaged, I think, but it shouldn't be too hard to
just extract all the files, creating any appropriate directories on the
way.

You could certainly run gunzip and tar, although you couldn't pipe the
result from one to the other unless you started a shell to do it. You
could gunzip from .tgz to .tar and then call tar afterwards though.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Berislav Lopac | last post by:
I'm trying to make a script with which I would be able to compress a number of files in a single archive, upload that archive, and then uncompress it on the server and put the files where I want...
4
by: Marek Möhling | last post by:
My server (Apache/1.3.28 - PHP/4.3.3) is configured to receive gzipped data via: Header append Accept-Encoding "gzip, deflate" PHP is configured to send gzipped data via: php_value...
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...
4
by: Eric Nelson | last post by:
I get a gzipped tar archive e-mailed to me every day. Thanks to help from this newsgroup I have a daily c# program that scans my outlook mail, finds the archive and saves it to a file. Now I'd...
1
by: Paul Smith | last post by:
Hi, I'd like to read a series of sqlite database files that have already been gzipped and was wondering if this can be done on the fly. In other words, can I avoid explicitly unzipping the file...
3
by: 2good2b | last post by:
Hi, How can I differentiate between regular content and gzipped content on websites? Are there any other kinds of contents I should refer to? (I'm talking about websites-not applications) I...
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...
0
by: DR | last post by:
Why is its substantialy slower to load 50GB of gzipped file (20GB gzipped file) then loading 50GB unzipped data? im using System.IO.Compression.GZipStream and its not maxing out the cpu while...
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: 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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.