mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
[Help] [Question] How to create a .tar.gz file? #584
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SuperJMN on GitHub (Sep 12, 2023).
Hi!
I want to create a tar.gz, but seeing the API I can't figure out how.
Thanks :)
BTW, I'm looking to create .deb packages from .NET (without external tools) and I saw that deb files are just tar.gz archives. That's ultimately what I want to do.
@btomblinson commented on GitHub (Sep 18, 2023):
Check GZipWriterTests, that has an example of writing a tar to a .gz, I don’t think there are any examples of creating the .tar first though
@adamhathcock commented on GitHub (Sep 18, 2023):
it should be just matter of selecting compression type with the TarWriter or TarArchive https://github.com/adamhathcock/sharpcompress/blob/master/tests/SharpCompress.Test/Tar/TarWriterTests.cs
@SuperJMN commented on GitHub (Oct 23, 2023):
I've tried with this, but I didn't get the desired results.
I hope anyone can shed a big of light. Thanks a lot!
@adamhathcock commented on GitHub (Oct 24, 2023):
make sure you're disposing everything....that Test1 isn't
@SuperJMN commented on GitHub (Oct 25, 2023):
OK, the problem doesn't seem to be related with the disposal, but with the way I added the entry:
as opposed to
Now it works.
@DannyBoyk commented on GitHub (Jan 26, 2024):
If you are working with a set of files in a directory, we found this works really well: