• 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: program launching another program, potential problem with path: how to do?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask: program launching another program, potential problem with path: how to do?


  • Subject: Re: NSTask: program launching another program, potential problem with path: how to do?
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 10 Apr 2014 07:32:30 -0700

On Apr 10, 2014, at 6:23 AM, Keary Suska <email@hidden> wrote:

> This is more likely a shell scripting issue, rather than am NSTask issue, unless sandboxing is somehow interfering, and you are obscuring the issue by not telling us at least how myprogram is locating myauxprogram. The most likely culprit is that the invocation of myauxprogram in myprogram is a relative path that relies on the PATH environment variable that is properly set by the shell, but you don't set in NSTask.

Agreed. A problem I’ve run into several times is that shells invoked from programs are not login shells, so they don’t run the same initialization scripts as the shell you use in a terminal. (For instance, a csh login shell runs ~/.login on startup as well as ~/.cshrc, but a non-login shell doesn’t. A similar thing happens with bash but I can never remember which scripts are involved.) If you customize your $PATH in the login-shell startup script, then a shellscript run outside a terminal window won’t have the same path.

—Jens
_______________________________________________

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


  • Follow-Ups:
    • Re: NSTask: program launching another program, potential problem with path: how to do?
      • From: Colas B <email@hidden>
References: 
 >NSTask: program launching another program, potential problem with path: how to do? (From: Colas B <email@hidden>)
 >Re: NSTask: program launching another program, potential problem with path: how to do? (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: button cell highlight/state/type
  • Next by Date: Re: NSDictionary @synchronize to read multiple objects
  • Previous by thread: Re: NSTask: program launching another program, potential problem with path: how to do?
  • Next by thread: Re: NSTask: program launching another program, potential problem with path: how to do?
  • Index(es):
    • Date
    • Thread