Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unzipping not working #673

Open
f15radar opened this issue Apr 1, 2023 · 3 comments
Open

unzipping not working #673

f15radar opened this issue Apr 1, 2023 · 3 comments

Comments

@f15radar
Copy link

f15radar commented Apr 1, 2023

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")
     }
    do
        {
            try SSZipArchive.unzipFile(atPath: zippath, toDestination: unzippath, overwrite: true,password:"icp")
        }
        catch
        {
        print("error unzipping")
        }
    print("after unzip")

Here is my output:

Zippath is /var/mobile/Containers/Data/Application/DCE37610-39D1-4E94-8690-8178D50C571D/Documents/file.csvallpics.ggg
unzippath is /var/mobile/Containers/Data/Application/DCE37610-39D1-4E94-8690-8178D50C571D/Documents/unzip
url path is /var/mobile/Containers/Data/Application/DCE37610-39D1-4E94-8690-8178D50C571D/Documents
Archive exists
dir writable
error unzipping
after unzip

I have checked the zipped up file and it is valid, although I don't think there is a password. I also tried with a blank password and received the same error.

I followed the code down and saw a 107 error

What is a 107 error and why is this not working?

@f15radar
Copy link
Author

f15radar commented Apr 1, 2023

More information. The zip file is create with SSZipArchive and is greater then 6gb. I tried using a smaller file and it works. Can i not unzip files greater then 6gb?

@f15radar
Copy link
Author

f15radar commented Apr 2, 2023

It looks like the zip file which was created with ZipArchive is somehow corrupt. Now to try and figure out why.

@f15radar
Copy link
Author

f15radar commented Apr 2, 2023

So I am very perplexed, can someone help me? I have 4400 pictures in an iPhoneXR. When I run them thru the createzip using the documents directory, 1 file always gets messed up. When I say messed up, if I look at it using 7 zip, 1 file (not the same file everytime) is currupted. One time it was file 1566, last time it was 465. What could the problem be? I have been working on this for days now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant