piped unzip
piped unzip
- Subject: piped unzip
- From: Stefan Fisk <email@hidden>
- Date: Wed, 18 Feb 2004 20:10:46 +0100
can anyone tell my the following code locks at "waitUntilExit:"?
- (NSData *)dataForKey:(NSString *)key {
NSTask *zip = [[[NSTask alloc] init] autorelease];
[zip setArguments:[NSArray arrayWithObjects:@"-p", path, key, nil]];
[zip setLaunchPath:@"/usr/bin/unzip"];
NSPipe *outputPipe = [NSPipe pipe];
[zip setStandardOutput:outputPipe];
[zip launch];
[zip waitUntilExit];
if ([zip terminationStatus] != 0)
return nil;
else
return [[outputPipe fileHandleForReading] readDataToEndOfFile];
}
it just runs: unzip -p <path to zipfile> <file in zip>
thanks on forehand
/Stefan Fisk
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.