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

Conditional unzip of files within a zip file? #69

Open
ColenMcA opened this issue Jul 15, 2013 · 4 comments
Open

Conditional unzip of files within a zip file? #69

ColenMcA opened this issue Jul 15, 2013 · 4 comments
Labels

Comments

@ColenMcA
Copy link

Hi,

When using SSZipArchive to extract the contents of an archive, we usually only need 1-2 files out of the dozens within the zip file, so extracting them all is pretty wasteful.

I'm planning to add a zipArchiveShouldUnzipFile: method to the delegate that will allow it to decide whether an individual file gets unzipped, which will be called before the WillUnzip method. Does this fit with your plans for SSZipArchive, and if so should I submit a pull request to incorporate this functionality into the main branch once I'm done?

Thanks for your help.

@karapigeon
Copy link

Please create a PR with the related improvements. Thanks!

@karapigeon karapigeon modified the milestone: 3.5 Apr 6, 2015
@karapigeon
Copy link

Irrelevant now. Read #163.

@Coeur Coeur removed this from the 2.1 milestone Oct 9, 2017
@Coeur
Copy link
Member

Coeur commented Oct 9, 2017

You can use this delegate method:
- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo;

It was added by #131 in ZipArchive 0.3.3

@Coeur
Copy link
Member

Coeur commented Oct 9, 2017

Hum, but it's not optimal... it will totally stop unzipping any additional file. We should have a nicer way to filter files, so I'm reopening this issue.

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

No branches or pull requests

3 participants