• 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: some NSTask Questons.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: some NSTask Questons.


  • Subject: Re: some NSTask Questons.
  • From: "W. W. Gilpin" <email@hidden>
  • Date: Fri, 23 Jul 2004 18:14:04 -0500

On Jul 21, 2004, at 5:25 PM, Kodex wrote:
I have a unix executabe file that i want to laucnh and
stop more then once from my program. NSTask seems to
be unable to do this according to its documentation.
Is there any way i can do this successfully? Thanks!


The same NSTask instance can not be used to launch it's task more than once. You will need to create a new NSTask instance each time you want to launch your unix executable.

To illustrate launching the same program twice:

NSString *thePath = <path to your executable>;
NSTask *theFirstExecution = [NSTask launchedTaskWithLaunchPath:thePath arguments:[NSArray array]];
[theFirstExecution waitUntilExit];

// Can't launch theFirstExecution again. Make another NSTask.
NSTask *theSecondExecution = [NSTask launchedTaskWithLaunchPath:thePath arguments:[NSArray array]];
[theSecondExecution waitUntilExit];

W. W. Gilpin
email@hidden
_______________________________________________
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: some NSTask Questons.
      • From: Nicholas <email@hidden>
References: 
 >some NSTask Questons. (From: Kodex <email@hidden>)

  • Prev by Date: Re: Design Principles
  • Next by Date: Re: Problem with NSScrollView & NSImageView
  • Previous by thread: Re: some NSTask Questons.
  • Next by thread: Re: some NSTask Questons.
  • Index(es):
    • Date
    • Thread