I have used ZipArchiver to unzip and it is working fine. But when it receives empty zip file, it goes error callback.
ZipArchive *za = [[ZipArchive alloc] init];
if ([za UnzipOpenFile: zipFilePath]) {
//Valid zip file code goes here.
}else {
//Unable to open zip file. May be empty or corrupted.
}
Is there any method to check a zip is really empty or just unzip error. A Boolean
value return will be most suitable solution.
Edit 1: I need a method to check a zip has any files or its just empty files.
Edit 2 : As mentioned by @iphonic, we cannot relay on size of a empty zip file. It simply cannot be zero. In my case, I got 22Bytes for empty zip file size.