GHC 6.8.1 on Mac OS X 10.5 (Leopard)
dgoldsmith at mac.com
Mon Nov 19 12:45:16 EST 2007
If you want to get the path to the main executable on Mac OS X, use
man 3 dyld
On Nov 19, 2007, at 4:07 AM, Christian Maeder wrote:
> An additional sanity check of "topdir" makes sense then.
> Alfonso Acosta wrote:
>> Simon, as usual, is right. It's been quite a while since I last
>> seriously coded in C. From the exec* man page:
>> "The first argument, *by convention*, should point to the file name
>> associated with the file being executed."
>> However, if nothing better is found I guess it's better to rely on an
>> extended convention rather than hardcoding paths.
>> On Nov 19, 2007 11:40 AM, Simon Marlow <simonmarhaskell at gmail.com>
>>> Christian Maeder wrote:
>>>> Alfonso Acosta wrote:
>>>>> On Nov 19, 2007 10:51 AM, Alfonso Acosta
>>>>> <alfonso.acosta at gmail.com> wrote:
>>>>>> Well, you can always combine the first argument of the script
>>>>>> ($0) for
>>>>>> absolute paths and combine it with with pwd for relative ones.
>>>>> I meant _use_ the first argument of the script ($0) for absolute
>>>>> and combine it with pwd for relative ones.
>>>> reldir=`dirname $0`
>>>> topdir=`(cd $reldir; pwd)`
>>> There's no guarantee that $0 holds anything reasonable: you can
>>> set $0 to
>>> whatever you like when calling exec*().
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
More information about the Glasgow-haskell-users