• 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: NSTask Memory Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask Memory Problems


  • Subject: Re: NSTask Memory Problems
  • From: Owen Anderson <email@hidden>
  • Date: Fri, 23 Jan 2004 17:10:40 -0500

Alright, I acted on the suggestions I got and modified the code like
such. However, it STILL SIGBUSs

-(NSArray*)findIt:(NSURL*)theURL
{
NSString* finder = [[[NSBundle mainBundle] pathForResource:@"finder"
ofType:@"py"] stringByStandardizingPath];
NSString* target = [theURL absoluteString];
NSString* tmpString = [[NSString alloc] init];

NSTask* search = [[NSTask alloc] init];
[search setLaunchPath:@"/usr/bin/python"];
NSMutableArray* args = [[NSMutableArray alloc] init];
[args addObject:finder];
[args addObject:target];
[search setArguments:args];
[search setStandardOutput:[NSPipe pipe]];
[search setCurrentDirectoryPath:@"/"];
[search launch];
NSData *data = nil;

while ([search isRunning]) {
data = [[[search standardOutput] fileHandleForReading] availableData];
if ((data != nil) && [data length]) {
tmpString = [tmpString stringByAppendingString:[[[NSString alloc]
initWithData:data
encoding:NSUTF8StringEncoding] autorelease]];
}
}

[args release];
[search release];

return [tmpString componentsSeparatedByString:@"\n"];
}
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSTask Memory Problems
      • From: j o a r <email@hidden>
References: 
 >NSTask Memory Problems (From: Owen Anderson <email@hidden>)
 >Re: NSTask Memory Problems (From: Daryn <email@hidden>)

  • Prev by Date: Cocoa Bindings: observeValueForKeyPath
  • Next by Date: Re: Cocoa Bindings: observeValueForKeyPath
  • Previous by thread: Re: NSTask Memory Problems
  • Next by thread: Re: NSTask Memory Problems
  • Index(es):
    • Date
    • Thread