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

Roman Haefeli reduzent at gmail.com
Fri Jan 7 17:58:07 CET 2022


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 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20220107/b45dc502/attachment.sig>


More information about the Pd-list mailing list