mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
Question : Find number of entries in the commpressed file #281
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 @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
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
@xupefei commented on GitHub (Mar 4, 2018):
Use
ArchiveFactorywhenever possible. It a lot faster thanReaderFactory.I say "whenever" because there are some formats which
ArchiveFactorydoes not handle well. For example, fora.tar.gz,ArchiveFactoryreturns only single file, which isa.gz. By contrast,ReaderFactoryenumerates all files inside.@trDiablo commented on GitHub (Mar 4, 2018):
Thx i have now the entry easily :)
For perfomances issues, i have same time with ReaderFactory or ArchiveFactory, decoding the whole file take 5 or 6 secondes (98 Mo, for 52 jpg entry).
I check my code to find if, and how, I can defer loading.
Thx