0

Im new in qt. I use quazip for compress a folder and it compressed successfully. But now if i want to know how many parents dir is available in unknown zip? how can i get count of parent dir from zip file? before unzip. please help me to get count of dir. Is it possible by quazip? how?

  • Hi there, I Have zip file and I choose it from QfileDialog so I get zip file path. Now I want to know how many folder and files are available in Zip without unzipping. i want to know count of files and folder which is inside zip file. – qwertyuiop Oct 15 '22 at 14:45

2 Answers2

0

QuaZip::getFileInfoList() should give you all the information needed. For the number of files just use the length of the returned list. Note that the file info is listed recursively. In case you need only the non-recursive content of a directory, go to that directory and iterate over all files with goToFirstFile() / goToNextFile().

Jens
  • 6,173
  • 2
  • 24
  • 43
0

I found the answer to my question:

Quazip zip("ZipFileName");

QuazipDir DirInZip(&zip);

int count = DirInZip.setFilter( QDir::Dir | QDir::NoDotAndDotDot|QDir::NoDot ).count();
Vi.
  • 940
  • 6
  • 24