De-compress a file from UNIX

  • Thread starter Thread starter Marc Jennings
  • Start date Start date
M

Marc Jennings

Hi there,

I have a problem in that I need to de-compress a file that was
compressed using the UNIX compress command. The resulting filename is
helloworld.xml.Z

I have looked at SharpZipLib, but haven't been able to make it work on
this file (perhaps this format is not supported?)

WinZip seems to cope perfectly happily with the file, but I need to be
able to do this programmatically.

Can anyone make any (hopefully helpful ;o) ) suggestions, please?

Thanks
Marc.
 
Marc,
I have a problem in that I need to de-compress a file that was
compressed using the UNIX compress command.
The resulting filename is helloworld.xml.Z.
I have looked at SharpZipLib, but haven't been able to make it work.

I'm not aware exactly how "Z" files are built, but most probably they are a
variant of the "zip"-family (LZW) of compression algorithms. So it might be
that they are like Zip files, but just with a different set of headers.
Since the "Z" format is used in Unix quite a lot, probably you could find
documentation of the file format somewhere, and even build your own
decompressor.

However, if you know in advance that you have access to WinZip on the host,
the you could easily command WinZip to decompress the file. WinZip has
published a free command-line add-on to the graphical WinZip utility, which
could prove helpful.

Another option is to take look at the new System.IO.Compression namespace in
..NET 2.0.

Hope this helps.

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(e-mail address removed)
http://www.saunalahti.fi/janij/
 
Marc Jennings said:
I have a problem in that I need to de-compress a file that was
compressed using the UNIX compress command. The resulting filename is
helloworld.xml.Z

I have looked at SharpZipLib, but haven't been able to make it work on
this file (perhaps this format is not supported?)

WinZip seems to cope perfectly happily with the file, but I need to be
able to do this programmatically.

Can anyone make any (hopefully helpful ;o) ) suggestions, please?

I *believe* that if you use SharpZipLib
(http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx) and
use the DeflaterOutputStream, you'll get the right results. I wouldn't
like to say for sure, but you should certainly give it a go :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top