Skip to content

Error upon encountering read-only directory within Zip file #352

Description

@jvtoomey

Summary

Running on iOS, if I have a zip file that has a read-only subfolder in it, and that subfolder has a file in it, it fails with the error:

You don’t have permission to save the file “Subfolder” in the folder

It doesn't happen if the subfolder in the zip file is read-write.
This seems similar to issue #52, except that I'm still encountering it with version 0.9.19.

Steps to Reproduce

Use the attached Xcode project. It has 2 zip files in its bundle that it will copy to the Library folder, where it does the extraction. Click the button labeled "click to unzip". It will copy the 2 zip filesReadOnly.zip and ReadWrite.zip from the Bundle to the Library directory. It will create the folders UnzipReadOnly and UnzipReadWrite. It will attempt to unzip them to their respective directories by calling unzipItem.

Expected Results

Both files should unzip.

Actual Results

The file ReadWrite.zip unzips fine. The file ReadOnly.zip will unzip the root directory in the zip file, but cannot proceed to the subfolder. You will see the errors
You don’t have permission to save the file “Subfolder” in the folder “ReadOnly”
and
Permission denied

Regression & Version

Using Xcode 15.4, ZipFoundation 0.9.19, iPhone 15 Simulator running iOS 17.5

zUnzipTest.zip

Related Link

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions