• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: piped unzip
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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>)

  • Prev by Date: piped unzip
  • Next by Date: Re: Special behavior when double-click NSTableView cell
  • Previous by thread: piped unzip
  • Next by thread: generate HTML from a NSAttributedString
  • Index(es):
    • Date
    • Thread