Question : Find number of entries in the commpressed file #278

Open
opened 2026-01-29 22:09:26 +00:00 by claunia · 0 comments
Owner

Originally created by @trDiablo on GitHub (Mar 4, 2018).

Hello,

Is it possible to know the number of entry in a Zip file without reading and count all entrie ?

Currently i use

int nb = 0;
while (reader.MoveToNextEntry())
{
   if (!reader.Entry.IsDirectory) nb++;
}

but i have a performance issue about 3 or 4 second to a Zip file of 98Mb with 52 entries in it.
I probably missed a documentation but I did not find how to do.

Thx for your help

Originally created by @trDiablo on GitHub (Mar 4, 2018). Hello, Is it possible to know the number of entry in a Zip file without reading and count all entrie ? Currently i use ``` int nb = 0; while (reader.MoveToNextEntry()) { if (!reader.Entry.IsDirectory) nb++; } ``` but i have a performance issue about 3 or 4 second to a Zip file of 98Mb with 52 entries in it. I probably missed a documentation but I did not find how to do. Thx for your help
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#278