Does anyone know a way to detect if a zip file has a pasword set when trying to unzip with the library ZipArchive
?
The code:
[zip UnzipOpenFile:unzipFilename Password:zipPassword]
will:
unzip files with a password when zipPassword is set.
unzip files without a password when zipPassword is nil
BUT
if directing a user to select a zip file I need to know whether to prompt the user for a password if the zip file has one otherwise all files in the zip are created but with zero length.
Seems messy to do this, check for zero length and if so prompt user for password for another try?
Surely there must be a way to tell if the zip file in question has a password?