【发布时间】:2014-11-13 10:27:33
【问题描述】:
是否可以使用objective-c将GZ转换为ZIP格式?
NSFileManager *fileManger = [NSFileManager defaultManager];
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *path = [paths objectAtIndex:0];
paths = nil;
path = [path stringByAppendingPathComponent:@"text.zip"];
if([fileManger fileExistsAtPath:path ] == NO){
NSString *testPath = [[NSBundle mainBundle] pathForResource:@"text" ofType:@"gz"];
[fileManger copyItemAtPath:@"" toPath:@"" error:&error];
}
将 gz 文件从 mainBundle 转换为 zip 文件,放置到 docuemtn 目录。
但无法通过 ZipArchive 类打开 zip 文件。
【问题讨论】:
-
什么压缩在
.gz文件中?是tar吗?
标签: objective-c iphone xcode ipad