mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-08 13:34:57 +00:00
ZipReader ignored DirectoryEntry completely #732
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 @zhuxb711 on GitHub (Nov 28, 2025).
Originally assigned to: @Copilot on GitHub.
ZipReader -> ignored DirectoryEntry completely | Could not extract the zip using ZipReader
095c871174/src/SharpCompress/Readers/Zip/ZipReader.cs (L63-L85)ZipArchive -> processed DirectoryEntry | Could extract the zip using ZipArchive
095c871174/src/SharpCompress/Archives/Zip/ZipArchive.cs (L261-L296)@zhuxb711 commented on GitHub (Nov 29, 2025):
@adamhathcock Would you please take a look about this issue?
@adamhathcock commented on GitHub (Nov 29, 2025):
I think I'm intentionally skipping them or used to. Will get copilot to check
@zhuxb711 commented on GitHub (Nov 29, 2025):
Why will ignore the directory entry intentionally? It doesn't make sense. This behavior makes it hard to extract a zip with nested directory inside. All I got is an empty output~ Sad...
@adamhathcock commented on GitHub (Nov 29, 2025):
I first wrote this for myself and skipped directory entries as I thought they didn't make sense with paths. I've since walked back on that. Formats are inconsistent though
@adamhathcock commented on GitHub (Nov 29, 2025):
Ah, right. Here's the real reason as found by AI:
// DirectoryEntry headers in the central directory are intentionally skipped.
// In streaming mode, we can only read forward, and DirectoryEntry headers
// reference LocalEntry headers that have already been processed. The file
// data comes from LocalEntry headers, not DirectoryEntry headers.
// For multi-volume ZIPs where file data spans multiple files, use ZipArchive
// instead, which requires seekable streams.