<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Hello,<div><br></div><div>+1 on the need for vanilla path management (<a class="aolmail_moz-txt-link-freetext" target="_blank" rel="noopener noreferrer" removedlink__eaddb1dc-0774-4c60-9f26-6eaa1b727474__href="https://github.com/pure-data/pure-data/pull/150" style="background-color: rgba(255, 255, 255, 0);"><font color="#000000">https://github.com/pure-data/pure-data/pull/150)</font></a></div><div><a class="aolmail_moz-txt-link-freetext" target="_blank" rel="noopener noreferrer" removedlink__eaddb1dc-0774-4c60-9f26-6eaa1b727474__href="https://github.com/pure-data/pure-data/pull/150" style="background-color: rgba(255, 255, 255, 0);"><font color="#000000"><br></font></a></div><div>Like Seb, I also made similar objects, [mainpath] and [root], as part of my personal library <a href="https://github.com/fdch/fd_lib">https://github.com/fdch/fd_lib</a>. </div><div><br></div><div><span style="background-color: rgba(255, 255, 255, 0);">[mainpath] gives the canvas full path and handles path names relative to it. It also fetches all files in a given directory (using dirent.h)</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">[root] gives out the root canvas name, which is useful both for regular pd messages and tcl related messages. </span></div><div><br></div><div><br></div><div><br></div><div><br><div id="AppleMailSignature"><a href="http://fdch.github.io/tv">fdch.github.io/tv</a><br><div><span style="background-color: rgba(255, 255, 255, 0);"><br class=""><br></span></div></div><div><br>On Oct 7, 2017, at 7:00 PM, Seb Shader via Pd-list <<a href="mailto:pd-list@lists.iem.at">pd-list@lists.iem.at</a>> wrote:<br><br></div><blockquote type="cite"><div><font color="black" size="2" face="arial">Hello,
<div>    I've made a [rootinfo] object in my library that gives the path, name, and relative level of the root canvas.</div>

<div>I also have a [makerpath] object that is supposed to take paths relative to the root canvas and transform them into absolute paths but it doesn't seem to work</div>

<div>correctly... I will update it tonight though.</div>

<div><br>
</div>

<div>available here <a href="https://github.com/sebshader/shadylib">https://github.com/sebshader/shadylib</a></div>

<div>might be in deken for linux and OS X.. not sure (thought the updated abstraction will only be on Github)</div>

<div><br>
</div>

<div>-Seb</div>

<div><br>
<br>

<div style="font-family:helvetica,arial;font-size:10pt;color:black">-----Original Message-----<br>
From: Jérôme Abel <<a href="mailto:abel.jerome@free.fr">abel.jerome@free.fr</a>><br>
To: pd-list <<a href="mailto:pd-list@iem.at">pd-list@iem.at</a>><br>
Sent: Sat, Oct 7, 2017 7:35 am<br>
Subject: [PD] Best way to make file paths relative to the parent patch ?<br>
<br>


<div id="AOLMsgPart_1.2_79c4160a-8b66-43da-ab08-90dcf85f1567">

<div text="#000000" bgcolor="#FFFFFF" class="aolReplacedBody">
    Hi,<br>

    <br>

    To explain myself, i have to describe a practical example
    (<a class="aolmail_moz-txt-link-freetext" target="_blank" rel="noopener noreferrer" removedlink__eaddb1dc-0774-4c60-9f26-6eaa1b727474__href="http://reso-nance.org/public/pd-malinette/test-paths.png">http://reso-nance.org/public/pd-malinette/test-paths.png</a>) :<br>

    - you write an [audio-sampler] abstraction in "abs" directory, which
    load soundfiles<br>

    - you write a "main.pd" patch where you put this abstraction in the
    project directory<br>

    - you want to load the "data/snare.wav" sound file with a message
    connected to the abstraction<br>

    <br>

    Result : the context of the abstraction is in "abs" directory, so it
    can't find "data/snare.wav" (there is no "abs/data/snare.wav" file),
    instead we have to write "../data/snare.wav" relative to the
    abstraction and not the parent patch.<br>

    <br>

    A common solution to deal with that is to add [ggee/getdir 1] 
    inside the abstraction, to get the absolute path of the file
    starting from the upper level (parent patch). But if the abstraction
    is inside another abstraction, it has to be [ggee/getdir 2] and so
    on ...  But how find the right depths of the abstraction ? The
    abstraction doesn't know his context of use.<br>

    <br>

    I think I will put a [ggee/getdir 10] or greater to be sure to get
    the parent patch level, but maybe someone has another solution, a
    vanilla solution ?<br>

    <br>

    <br>

    Related PR :<br>

    <ul>
      <li><a class="aolmail_moz-txt-link-freetext" target="_blank" rel="noopener noreferrer" removedlink__eaddb1dc-0774-4c60-9f26-6eaa1b727474__href="https://github.com/pure-data/pure-data/pull/150">https://github.com/pure-data/pure-data/pull/150</a></li>
    </ul>
    <br>

    <br>

    +<br>

    j.<br>

    <br>

    <br>

    <br>

  

</div>

</div>

_______________________________________________
Pd-<a removedlink__eaddb1dc-0774-4c60-9f26-6eaa1b727474__href="mailto:list@lists.iem.at">list@lists.iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a removedlink__eaddb1dc-0774-4c60-9f26-6eaa1b727474__href="https://lists.puredata.info/listinfo/pd-list" target="_blank">https://lists.puredata.info/listinfo/pd-list</a>
</div>
</div>
</font></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span><a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list</span><br><span>UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list">https://lists.puredata.info/listinfo/pd-list</a></span><br></div></blockquote></div></body></html>