On 24 Oct 2010, at 18:48, Thomas Clement wrote:

> On 24 oct. 2010, at 19:03, eveningnick eveningnick wrote:
> 
>> Hello!
>> I am wondering, if  NSTask can be replaced with low-level fork/exec
>> calls. Looking through forums, i often met statements that launching a
>> process with "fork/exec" is not an "OS X way", especially if i am
>> using Cocoa framework (and i am using Cocoa!).
> 
> Yes you can use fork/exec, that's what NSTask does.

FWIW, the "modern" UNIX way is to use posix_spawn(), which has some advantages 
over fork()/exec().  There's nothing wrong with using fork()/exec() or 
posix_spawn() in a Cocoa app, though do note that what you can do between the 
fork() and exec() calls is extremely limited---higher level frameworks, Cocoa 
included, are generally totally off-limits at that point.

Kind regards,

Alastair.

--
http://alastairs-place.net




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to