Re: some NSTask Questons.
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.