tar.gz uncompressing always leads to no tar.entries #693

Open
opened 2026-01-29 22:16:02 +00:00 by claunia · 1 comment
Owner

Originally created by @alexey-shilkin on GitHub (Jul 22, 2025).

There is valid one.tar.gz file - one.tar.gz
Tar contains one file.

When I try to uncompress it, tarArchive.Entries.Count == 0, but it should be 1 because tar contains one file

    using (var archive = GZipArchive.Open("D:\\one.tar.gz")) {
      GZipArchiveEntry gzipEntry = archive.Entries.First(); // gzipEntry value is right, i .e it contains details of tar file
      Stream tarStream = gzipEntry.OpenEntryStream();

      using (TarArchive tarArchive = TarArchive.Open(tarStream)) {
        var cnt = tarArchive.Entries.Count;// tarArchive.Entries.Count == 0 but it should be 1
      }

Same problem wih all tar.gz files

I use 0.40.0 latest nuget + .NET 9

Originally created by @alexey-shilkin on GitHub (Jul 22, 2025). There is valid one.tar.gz file - [one.tar.gz](https://github.com/user-attachments/files/21371378/one.tar.gz) Tar contains one file. When I try to uncompress it, tarArchive.Entries.Count == 0, but it should be 1 because tar contains one file using (var archive = GZipArchive.Open("D:\\one.tar.gz")) { GZipArchiveEntry gzipEntry = archive.Entries.First(); // gzipEntry value is right, i .e it contains details of tar file Stream tarStream = gzipEntry.OpenEntryStream(); using (TarArchive tarArchive = TarArchive.Open(tarStream)) { var cnt = tarArchive.Entries.Count;// tarArchive.Entries.Count == 0 but it should be 1 } Same problem wih all tar.gz files I use 0.40.0 latest nuget + .NET 9
Author
Owner

@Morilli commented on GitHub (Aug 20, 2025):

Your use case is not supported, see #927.

@Morilli commented on GitHub (Aug 20, 2025): Your use case is not supported, see #927.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#693