Extended to allow passing in directory or file to unzip to

This commit is contained in:
Sam Singh
2016-09-05 20:40:00 -04:00
parent 503373bc53
commit d1e5f47e29

View File

@@ -272,7 +272,16 @@
strPath = [strPath stringByReplacingOccurrencesOfString:@"\\" withString:@"/"];
}
NSString *fullPath = [destination stringByAppendingPathComponent:strPath];
NSString *fullPath;
BOOL isDir = NO;
if([[NSFileManager defaultManager]
fileExistsAtPath:destination isDirectory:&isDir] && isDir){
fullPath = [destination stringByAppendingPathComponent:strPath];
}
else {
fullPath = destination;
}
NSError *err = nil;
NSDictionary *directoryAttr;
if (preserveAttributes) {