• 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: Restarting an app -- AppleScript 'launch' in a detached shell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Restarting an app -- AppleScript 'launch' in a detached shell (From: Steve Cronin <email@hidden>)
 >Re: Restarting an app -- AppleScript 'launch' in a detached shell (From: Andrew Farmer <email@hidden>)
 >Re: Restarting an app -- AppleScript 'launch' in a detached shell (From: Steve Cronin <email@hidden>)

  • Prev by Date: Re: How to get music list?
  • Next by Date: Re: CoreData fetched property: one-to-one-to-many relationship
  • Previous by thread: Re: Restarting an app -- AppleScript 'launch' in a detached shell
  • Next by thread: Re: Restarting an app -- AppleScript 'launch' in a detached shell
  • Index(es):
    • Date
    • Thread