Re: fork/exec vs NSTask
Re: fork/exec vs NSTask
- Subject: Re: fork/exec vs NSTask
- From: Thomas Clement <email@hidden>
- Date: Sun, 24 Oct 2010 21:14:14 +0200
On 24 oct. 2010, at 20:03, eveningnick eveningnick wrote:
>
>> Not great but should work.
>> Better would be to use LaunchServices, if not possible I would use SMJobSubmit() (ServicesManagement framework).
> Could you please explain why? What steps do i omit, if using fork/exec?
LaunchServices / SMJobSubmit will directly do the right thing for you (launch the process in the correct context).
No need to double fork and kill the parent.
In Mac OS X, using daemon(3) or doing the moral equivalent by calling fork() and having the parent process exit() is discouraged in favor of using launchd.
Note that SMJobSubmit if the equivalent API of the launchctl command mentioned by Greg.
Thomas_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden