• 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: NSTask vs. popen vs. System
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask vs. popen vs. System


  • Subject: Re: NSTask vs. popen vs. System
  • From: Chris Ridd <email@hidden>
  • Date: Tue, 03 Dec 2002 18:19:26 +0000

On 3/12/02 5:26 pm, John Timmer <email@hidden> wrote:

> Just a quick clarification question while NSTasks are on people's minds:
>
> Having looked through a bunch of examples and potential uses, I'd made the
> judgment that one should:
> Use System if you don't care what happens with the process you're launching.
> Use popen if you just want to grab the output of the process, and don't care
> if you do things asynchronously.
> Use NSTask if you need to run things interactively and asynchronously.
>
> Is this fairly accurate, or have I missed something?

Both popen and system execute the process using sh, so the arguments you
pass have to be properly quoted and escaped. This is easy to do wrong (hello
iTunes installer :-) and generally it is easier to just use NSTask.

Cheers,

Chris
_______________________________________________
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.

References: 
 >NSTask vs. popen vs. System (From: John Timmer <email@hidden>)

  • Prev by Date: Trouble with TIFFs...
  • Next by Date: Re: Debugging Cocoa Apps
  • Previous by thread: NSTask vs. popen vs. System
  • Next by thread: Thanks (was: NSTextField & controlTextDidChange:)
  • Index(es):
    • Date
    • Thread