Extracting taz files (LZW) #199

Open
opened 2026-01-29 22:08:11 +00:00 by claunia · 5 comments
Owner

Originally created by @pjeannet on GitHub (Jun 30, 2017).

Hi, I know that Z archives are not officially supported but I can't find a lib able to open taz archives (or tar.z). Do you confirm that these archives are not supported?
I can't change the original sources and opening all the archives by hand with 7zip does not seem too appealing.

Thanks

Originally created by @pjeannet on GitHub (Jun 30, 2017). Hi, I know that Z archives are not officially supported but I can't find a lib able to open taz archives (or tar.z). Do you confirm that these archives are not supported? I can't change the original sources and opening all the archives by hand with 7zip does not seem too appealing. Thanks
claunia added the enhancementup for grabs labels 2026-01-29 22:08:11 +00:00
Author
Owner

@adamhathcock commented on GitHub (Jun 30, 2017):

What is a Z archive?

According to this: https://en.wikipedia.org/wiki/List_of_archive_formats It's just a deflate stream with a tar underneath. You should be able to use SharpCompress but it isn't supported in the detection under ReaderFactory Upper case Z is LZW which isn't supported (might be easy to add an implementation though)

You'd just decompress the file initially with a DeflateStream then pass the stream to a TarReader. That might work. You'll have to test it.

@adamhathcock commented on GitHub (Jun 30, 2017): What is a Z archive? According to this: https://en.wikipedia.org/wiki/List_of_archive_formats It's just a deflate stream with a tar underneath. You should be able to use SharpCompress but it isn't supported in the detection under `ReaderFactory` Upper case Z is LZW which isn't supported (might be easy to add an implementation though) You'd just decompress the file initially with a DeflateStream then pass the stream to a `TarReader`. That might work. You'll have to test it.
Author
Owner

@pjeannet commented on GitHub (Jun 30, 2017):

Not really sure myself, I got some .taz files and a quick search told me it was for .tar.Z and an old format. 7zip ingo on the archive confirmed the Z compression part.
Fun part is that the recent files were decompressed by the readerfactory but not the old ones. Make me think that recent ones are .tar.gz renamed in .taz by the people editing these sources.
I'll see on monday if the deflatestream works but I'm affraid it is LZW (7zip info gives upper case Z as compression format)
Side question : are .tar.gz supposed to be decompressed in one go by reader factory or should we do this in two steps?

@pjeannet commented on GitHub (Jun 30, 2017): Not really sure myself, I got some .taz files and a quick search told me it was for .tar.Z and an old format. 7zip ingo on the archive confirmed the Z compression part. Fun part is that the recent files were decompressed by the readerfactory but not the old ones. Make me think that recent ones are .tar.gz renamed in .taz by the people editing these sources. I'll see on monday if the deflatestream works but I'm affraid it is LZW (7zip info gives upper case Z as compression format) Side question : are .tar.gz supposed to be decompressed in one go by reader factory or should we do this in two steps?
Author
Owner

@adamhathcock commented on GitHub (Jul 1, 2017):

Tar.gz should be done in a single usage of ReaderFactory as a feature. It takes care of decompressing as gzip then tar on the fly.

The same could be done for tar.z and tar.Z but the first just isn’t implemented and the second requires lzw which I don’t have at the moment.

@adamhathcock commented on GitHub (Jul 1, 2017): Tar.gz should be done in a single usage of ReaderFactory as a feature. It takes care of decompressing as gzip then tar on the fly. The same could be done for tar.z and tar.Z but the first just isn’t implemented and the second requires lzw which I don’t have at the moment.
Author
Owner

@pjeannet commented on GitHub (Jul 3, 2017):

I just tested the deflate stream but got following error :

System.IO.InvalidDataException: 'The archive entry was compressed using an unsupported compression method.'

I'll have to do part of the work by hand and wait for some support (though I would understand if you don't have time for it as it is not a common format).

@pjeannet commented on GitHub (Jul 3, 2017): I just tested the deflate stream but got following error : ``` System.IO.InvalidDataException: 'The archive entry was compressed using an unsupported compression method.' ``` I'll have to do part of the work by hand and wait for some support (though I would understand if you don't have time for it as it is not a common format).
Author
Owner

@adamhathcock commented on GitHub (Jul 5, 2017):

LZW might be easy to do with an existing implementation but yeah not a high priority for me. Pull requests are welcome :)

@adamhathcock commented on GitHub (Jul 5, 2017): LZW might be easy to do with an existing implementation but yeah not a high priority for me. Pull requests are welcome :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#199