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

Zipping a folder #3

Closed
Isuru-Nanayakkara opened this issue Jan 21, 2016 · 3 comments
Closed

Zipping a folder #3

Isuru-Nanayakkara opened this issue Jan 21, 2016 · 3 comments

Comments

@Isuru-Nanayakkara
Copy link

I tested this this library with zipping a bunch of files inside a folder and it works great. However zipping that said folder itself results in a file of a format called CPGZ when it is unzipped.

screen shot 2016-01-21 at 9 06 42 am

Is zipping a folder not supported or am I doing something wrong? Here's the snippet of code.

do {
    let folderPath = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent("My Images")
    try Zip.zipFiles([folderPath], zipFilePath: zipPath, password: nil, progress: { progress in
        print(progress)
    })
} catch {
    print("Zipping failed :(")
}

I've uploaded a demo project to Dropbox here.

@marmelroy
Copy link
Owner

zipFiles is currently expecting NSURLs of filePaths and not a folderPath. You can grab the contents of the folder path and pass them to zipFiles.

That said, being able to zip a folder path would be useful. I'll add this to a future version.

@marmelroy
Copy link
Owner

Hi @Isuru-Nanayakkara, this is now solved with 075ee6c

I want to add some folder-specific tests before bundling this feature in the next release but you can try it in the meantime.

Thanks again for the question. Closing this issue.

@marmelroy
Copy link
Owner

Released.

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

2 participants