Re: NSTask vs. popen vs. System
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.