Re: fork/exec vs NSTask
Re: fork/exec vs NSTask
- Subject: Re: fork/exec vs NSTask
- From: Greg Guerin <email@hidden>
- Date: Sun, 24 Oct 2010 11:10:46 -0700
eveningnick wrote::
Basically this is the question about using fork in MacOS. But if there
are other ways to launch a process, i'd appreciate if someone shared
:)
Maybe setup a launchd plist specifying the target executable you want
to run, then ask launchd to run it by executing the 'launchctl'
command in an NSTask. The plist can be generated dynamically if needed.
One reason for doing this with launchd is it will take care of a lot
of bookkeeping for you. There are also a lot of different conditions
and launch options that can be embedded in a launchd plist.
See 'man launchd.plist', and also TN2083 "Daemons and Agents":
http://developer.apple.com/mac/library/technotes/tn2005/tn2083.html
If your target app has a GUI, it's an agent. If it has no GUI at
all, it can be a daemon or an agent. Read TN2083 for more details; a
*LOT* more details, including some that affect use of fork/exec.
And since you said you don't have a lot of experience in Mac
programming, maybe you can explain why you think fork/exec is the
most appropriate solution. For example, list your requirements, your
inter-process communications, etc. Maybe Distributed Objects is more
appropriate, but no one would ever suggest it without knowing what
you're trying to do.
-- GG
-- GG
_______________________________________________
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