adamhathcock / sharpcompress

SharpCompress is a fully managed C# library to deal with many compression types and formats.
MIT License
2.27k stars 481 forks source link

xz compression not supported #700

Open laraaj opened 2 years ago

laraaj commented 2 years ago

Hi,

I just tested the following code to compress a folder into file Archive.tar.xz

            using (Stream stream = File.OpenWrite("../Archive.tar.xz"))
            using (var writer = WriterFactory.Open(stream, ArchiveType.Tar, CompressionType.Xz))
            {

                writer.WriteAll(".", "*", SearchOption.AllDirectories);
            }

but it returned the following error :

SharpCompress.Common.InvalidFormatException: 'Tar does not support compression: Xz'

is .xz compression supported ?

adamhathcock commented 2 years ago

Xz is decompression only https://github.com/adamhathcock/sharpcompress/blob/master/FORMATS.md