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