Re: Setting env vars from Cocoa with /bin/sh?
Re: Setting env vars from Cocoa with /bin/sh?
- Subject: Re: Setting env vars from Cocoa with /bin/sh?
- From: "David Piasecki" <email@hidden>
- Date: Wed, 14 Apr 2004 09:28:42 -0700
You know, I ended up solving this problem with the setenv() standard C
function. I just pass a command to the system function, and it works
great.
David
On Apr 14, 2004, at 9:08 AM, M. Uli Kusterer wrote:
At 18:11 Uhr -0700 08.04.2004, David Piasecki wrote:
I figured out how to set my environment variables from the terminal
window with /bin/sh, but it doesn't seem to accept the same commands
from my Cocoa program.
I'm trying to do VAR=/Path/To/Whatever
Any ideas how to do this from the confines of Cocoa and
Objective-C/C++?
Sorry, backlogged, so I hope I'm not stumbling in late here, but ...
Are you perchance using NSTask to run /bin/sh? NSTask lets you pass
in an NSDictionary of environment variables and values to assign to
them. That sounds like a very useful way of getting things set up
without too much pain.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.