We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Using this code to create an archive, I'm unable to open in Windows or MAC.
ZZArchive* archive = [[ZZArchive alloc] initWithURL:url options:@{ZZOpenOptionsCreateIfMissingKey : @YES} error:&error]; if (error == nil) { NSMutableArray* entries = [NSMutableArray array]; for (NSURL* fileURL in fileURLs) { NSURL* fileURLCopy = fileURL; fileAttributes = [fm attributesOfItemAtPath:fileURL.path error:&error]; fileSumSize += fileAttributes.fileSize; NSString* subFile = [fileURL.path substringFromIndex:root.length]; NSString* subDir = [subFile stringByDeletingLastPathComponent]; if (subDir.length > 0 && ![dirs containsObject:subDir]) { [dirs addObject:subDir]; ZZArchiveEntry* dirEntry = [ZZArchiveEntry archiveEntryWithDirectoryName:subDir]; [entries addObject:dirEntry]; } ZZArchiveEntry* entry = [ZZArchiveEntry archiveEntryWithFileName:subFile compress:NO streamBlock:^(NSOutputStream* output, NSError** _error) { uint8_t buffer[8192]; NSInputStream* input = [NSInputStream inputStreamWithFileAtPath:fileURLCopy.path]; NSInteger count; [input open]; while ((count = [input read:buffer maxLength:8192]) > 0) { NSInteger written = 0; while (written < count) { written += [output write:buffer + written maxLength:count - written]; bytesWritten += written; } } [input close]; [self updateProgress:++filesWritten total:fileURLs.count]; return YES; }]; [entries addObject:entry]; } if (error == nil) { [archive updateEntries:entries error:&error]; }
The text was updated successfully, but these errors were encountered:
From inspection, I don't see any issues with the code.
Please supply a self-contained Xcode project with sample files and the minimal code needed to show the problem.
Sorry, something went wrong.
No branches or pull requests
Using this code to create an archive, I'm unable to open in Windows or MAC.
The text was updated successfully, but these errors were encountered: