Re: piped unzip
Re: piped unzip
- Subject: Re: piped unzip
- From: Ondra Cada <email@hidden>
- Date: Wed, 18 Feb 2004 20:22:02 +0100
Hi,
On Wednesday, Feb 18, 2004, at 20:10 Europe/Prague, Stefan Fisk wrote:
can anyone tell my the following code locks at "waitUntilExit:"?
I am not sure, but what about the pipe buffer being full, so that the
task waits till the data are read out (which they aren't, of course)?
- (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];
}
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.
References: | |
| >piped unzip (From: Stefan Fisk <email@hidden>) |