Wrapping NSTask, setting PATH env var to current user's PATH...
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