SSZipArchive not unzipping

54 views Asked by At

I have the following code:

   print("Zippath is "+zippath)
   print("unzippath is "+unzippath)
   print("url path is "+url.path)
   let fileManager1 = FileManager.default
   if fileManager1.fileExists(atPath: zippath) {
            print("Archive exists")
   }
   if fileManager1.isWritableFile(atPath: unzippath){
            print("dir writable")
   }
   print(SSZipArchive.unzipFile(atPath: zippath, toDestination: unzippath))
 

The output shows:

zippath is /var/mobile/Containers/Data/Application/64D975C2-66EB-4F8F-8E70-D9117AF588D4/Documents/file.csvallpics.ggg
unzippath is /var/mobile/Containers/Data/Application/64D975C2-66EB-4F8F-8E70-D9117AF588D4/Documents/unzip
url path is /var/mobile/Containers/Data/Application/64D975C2-66EB-4F8F-8E70-D9117AF588D4/Documents
Archive exists
dir writable
false

I have verified the zip file is valid by copying it to a PC and unzipping it. The unzip dir is there and is both readable and writeable. I don't understand why its not working.

After running the code, I expect to see files in the unzip directory but there isn't any.

0

There are 0 answers