Home > Software engineering >  how get count of parent Directories from zip (Compressed) file in qt c ?
how get count of parent Directories from zip (Compressed) file in qt c ?

Time:10-19

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?

CodePudding user response:

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().

CodePudding user response:

I got answer of my above question Quazip zip("ZipFileName"); QuazipDir DirInZip(&zip); int count=DirInZip.setFilter( QDir::Dir | QDir::NoDotAndDotDot|QDir::NoDot ).count();

  • Related