<div dir="ltr">Have you tried [file which] ?<br clear="all"><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 7 janv. 2022 à 17:58, Roman Haefeli <<a href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 2022-01-07 at 17:34 +0100, Roman Haefeli wrote:<br>
> Dear list<br>
> <br>
> When using a relative path with the new [file], it is resolved<br>
> relative<br>
> to Pd's start location and not relative to the patch.<br>
<br>
I'd like to work-around this with [dir(-[pdcontrol] which returns the<br>
directory of the patch which can be used to construct an absolute path<br>
with a given relative path.<br>
However, the hard part is to reliably detect whether a given path is<br>
relative. I thought I could check for absolute paths by checking if the<br>
first byte is a '/' OR the second byte is a ':'. However, it turns out<br>
'C:' is a perfectly valid name for a directory on ext4, for instance.<br>
Doing that detection reliably turns out to be quite hard and probably<br>
involves detecting the OS.<br>
<br>
Or am I overlooking a simpler vanilla way?<br>
Roman <br>
_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>