• 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: Calling UNIX command from Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling UNIX command from Cocoa


  • Subject: Re: Calling UNIX command from Cocoa
  • From: "Clark Cox" <email@hidden>
  • Date: Fri, 17 Oct 2008 17:52:05 -0700

On Fri, Oct 17, 2008 at 4:14 PM, Aurora Phoenix
<email@hidden> wrote:
>
> Without knowing more specifics, I am struggling to find why one would need a
> full-blown class just to invoke a command.

Because it is easier to use, and it handles many edge cases. Also, you
are over-estimating the overhead of using a "full-blown class"; it is
lost in the noise when compared to the actual process
creation/launching.

> At the simplest, one could use
> the system(3) call

system() (or popen) will get a shell involved, thereby adding unneeded
complexity.

>, or the exec/spawn/fork/popen families depending on what
> you need.

Using NSTask *is* using the exec/spawn/fork families, just wrapped in
a cleaner interface.

> It is of course, possible to wrap up something fancy like using an
> NSDictionary to represent commandline arguments, etc. etc. but that is
> usually overkill, no?

It is only overkill because NSTask already exists. :)

--
Clark S. Cox III
email@hidden
_______________________________________________

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

References: 
 >Calling UNIX command from Cocoa (From: development2 <email@hidden>)
 >Re: Calling UNIX command from Cocoa (From: Aurora Phoenix <email@hidden>)

  • Prev by Date: Re: Objective 2.0 properties
  • Next by Date: Re: Delete myDriver.kext files from normal user.
  • Previous by thread: Re: Calling UNIX command from Cocoa
  • Next by thread: Desired Tabbing order not working
  • Index(es):
    • Date
    • Thread