Re: Restarting an app -- AppleScript 'launch' in a detached shell
Re: Restarting an app -- AppleScript 'launch' in a detached shell
- Subject: Re: Restarting an app -- AppleScript 'launch' in a detached shell
- From: "Kyle Sluder" <email@hidden>
- Date: Mon, 4 Aug 2008 02:56:10 -0400
On Mon, Aug 4, 2008 at 2:15 AM, Steve Cronin <email@hidden> wrote:
> I have 4 questions
> 1) Given that it is higher-level than necessary, I would still appreciate
> understanding why it doesn't work.
Race conditions, waiting on the child task to complete, reliance on
shell parsing semantics... there are plenty of reasons why your
original solution could fail.
> 2) In the script you cited, I don't understand the 'if(fork() || fork())'
> conditional test. Can you clarify this statement?
fork returns 0 in the child, which forces the short-circuit or test to
evaluate its right hand side. Then, in the child, the if test will
fail becuase this fork will also return zero. It's a shorthand way to
create a grandchild processes.
> 3) Why are you using 'execl' and not 'exec'?
There is no function called exec. `man 3 exec` brings up the manpage
for the exec family of functions... notice there's no exec function
actually listed.
--Kyle Sluder
_______________________________________________
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