[PD] get dir of current pd

Jonathan Wilkes jancsika at yahoo.com
Tue Jul 30 08:41:56 CEST 2013


On 07/20/2013 11:13 AM, Jonathan Wilkes wrote:
> On 07/18/2013 02:16 PM, Jonathan Wilkes wrote:
>> On 07/17/2013 09:44 AM, Max wrote:
>>> is there something like [ggee/getdir] but for getting the path of 
>>> the currently running Pd binary?
>>
>> Seems like I saw this somewhere, but I can't remember where.
>>
>> I'll add it to [pdinfo]
>
> Hm... there's a function pd_getdirname listed in m_pd.h, but it's a 
> mirage because the
> function isn't defined anywhere.
>
> What's the story?

Ok, I figured out how to do this, but:

1) Why do you need the directory of the pd binary?  Finding the 
directory of a running
executable is tricky-- I can set it up for Windows and most Linuxes but 
there might
be a distro where it wouldn't work, or a new OS that needs yet another 
trick to find
it.  I guess this is why pd_getdirname doesn't actually get defined 
anywhere...

Getting the current working directory is pretty straightforward, though 
I don't know
if that's useful.

-Jonathan



More information about the Pd-list mailing list