[PD] saving relative paths in a textfile

Mathieu Bouchard matju at artengine.ca
Tue Feb 1 20:07:43 CET 2011


On Tue, 1 Feb 2011, Athos Bacchiocchi wrote:

> The problem with openpanel is that it outputs absolute paths, making the 
> textfile useless in case i move the entire patch (with wavfiles as well, 
> without modifying the relative positions), to another position or 
> machine. Can anyone point me in the right direction? Maybe there is a 
> specific object, but an entire day of googling didn't get me anywhere.

[gf/find_file] searches the pd path (list of -path options or equivalent 
menu in the settings). But because it also counts the folder of the 
current patch as a path item, you can use it to look for the patch 
itself :
   http://gridflow.ca/help/gf/find_file-help.html

If you don't want to have to type the name of the patch, you can use 
[gf/canvas_filename] to find it :
   http://gridflow.ca/help/gf/canvas_filename-help.html

But note that if the pd patch was open with a location relative to the 
CWD, then [gf/find_file] may output a relative name, as in the screenshot. 
For example, the screenshot may have been made with these Terminal 
commands :
   cd /home/matju/src/gridflow/doc/flow_classes
   pd gf/find_file-help.pd
or
   pd -send "pd open find_file-help.pd gf"

and in such cases, the reported location will be incomplete, though it can 
be completed using [gf/getcwd] :
   http://gridflow.ca/help/gf/getcwd-help.html

Isn't that a few useful hints ?

  _______________________________________________________________________
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC


More information about the Pd-list mailing list