Re: [Pyobjc-dev] bootstrapping with execve in /bin/sh?
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2002-11-26 16:32:53
|
On Tuesday, November 26, 2002, at 08:29 AM, Just van Rossum wrote: > I'm not sure, but I _think_ it's because 'exec' in /bin/sh isn't > exactly the > same as execve(). Does this sound plausible? If so, what _is_ the > equivalent of > execve() in sh? Also: the exporting of PYTHONPATH doesn't work as > written above: > os.environ doesn't show it. > > Any clues? (googling for "execve" and "sh" only gives me hits for > execve("/bin/sh", ...); ;-) In the child process, argv[0] -- the name of the process -- must contain the path to the app wrapper or else the resources within can't be found. If you were to 'print NSBundle.mainBundle().bundlePath()', you would find that it points to /usr/local/bin/. This is a limitation of CFBundle/NSBundle -- there is no other way to tell it which directory should be used as the mainBundle. Basically, Apple needs to move the automatic initialization of the main bundle such that the developer can set the path prior to initialization. Python solves a similar problem through the Py_SetProcessName() function. In any case, I don't know if there is an analogy for execve() in shell speak... b.bum |