[PD] [file]: paths not relative to patch

Antoine Rousseau antoine at metalu.net
Fri Jan 7 18:11:01 CET 2022


Have you tried [file which] ?


Le ven. 7 janv. 2022 à 17:58, Roman Haefeli <reduzent at gmail.com> a écrit :

> On Fri, 2022-01-07 at 17:34 +0100, Roman Haefeli wrote:
> > Dear list
> >
> > When using a relative path with the new [file], it is resolved
> > relative
> > to Pd's start location and not relative to the patch.
>
> I'd like to work-around this with [dir(-[pdcontrol] which returns the
> directory of the patch which can be used to construct an absolute path
> with a given relative path.
> However, the hard part is to reliably detect whether a given path is
> relative. I thought I could check for absolute paths by checking if the
> first byte is a '/' OR the second byte is a ':'. However, it turns out
> 'C:' is a perfectly valid name for a directory on ext4, for instance.
> Doing that detection reliably turns out to be quite hard and probably
> involves detecting the OS.
>
> Or am I overlooking a simpler vanilla way?
> Roman
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management ->
> https://lists.puredata.info/listinfo/pd-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20220107/84cdf925/attachment.htm>


More information about the Pd-list mailing list