• 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
Wrapping NSTask, setting PATH env var to current user's PATH...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wrapping NSTask, setting PATH env var to current user's PATH...


  • Subject: Wrapping NSTask, setting PATH env var to current user's PATH...
  • From: John Joyce <email@hidden>
  • Date: Tue, 15 Jan 2008 20:11:08 -0600

Hi everyone,
I'm wrapping command-line tools with NSTask (while getting a hang of Cocoa, so be gentle).
I'm far more used to working at the command line and with Ruby in particular, but I'm not currently interested in RubyCocoa, more in learning Cocoa itself.
I need some help here with setting the PATH environment variable of the NSTask process to the current user's PATH environment variable.
Would this require some mucking around in the various dot-files in a user's home directory and reading .bash_login, .bashrc, .bash_profile, etc...?
Or is there some stupid simple Cocoa method of getting the user's PATH setting and setting the NSTask's environment dictionary's PATH key's value?



What I've currently got is a simple wrapper for the 'which' tool. I'm trying to use it for sanity checking for other tool wrappers, to check for the existence of tools on launch.
In particular this will make it easy to ensure that the one found in the user's PATH (most likely version of a given tool that the user would expect to be used) is the tool that is used.


I do have both of the Advanced OS X Programming book and have played with the Moriarity task wrapper app from ADC.

Cheers,
John Joyce
_______________________________________________

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


  • Prev by Date: Re: designing beyond MV and (one) C
  • Next by Date: re: More CoreData questions...
  • Previous by thread: Re: How to get pixel information from CIImage of QT frame
  • Next by thread: RE: Wrapping NSTask, setting PATH env var to current user's PATH...
  • Index(es):
    • Date
    • Thread