----Messaggio originale---- Da: matju@artengine.ca [gf/find_file]
searches the pd path (list of -path options or equivalent
menu in the
settings). [cut]
If you don't want to have to type the name of the
patch, you can use
[gf/canvas_filename] to find it :
[cut]
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.
[cut]
and in such cases, the reported location will be incomplete,
though it can
be completed using [gf/getcwd]
thank you mathieu,
If i didn't misunderstood, your hint is to get the patch's path and compare it with the sound file's path given by openpanel, to obtain a relative path.
So, as an example, if the patch containing the arrays stays in:
/home/athos/pd/mypatch
And the sound files are in
/home/athos/pd/samples
Openpanel will output:
/home/athos/pd/samples/sound.wav
Using the gridflow objects:
[bang( |
[gf/canvas_filename 0] | [gf/find_file 0]
I get:
/home/athos/pd/mypatch/mypatch.pd
(using [getdir] i can directly obtain: /home/athos/pd/mypatch)
And i will try to get:
.. /samples/sound.wav
I guess starting with [s2l] and some list comparing objects.
Am I on the right "path"? :)
athos
PS: i tried opening the patch doing cd /home/athos/pd/mypatch pdextended mypatch.pd and i still get an absolute path from [gf/find_file 0]
On Wed, 2 Feb 2011, Athos Bacchiocchi wrote:
If i didn't misunderstood, your hint is to get the patch's path and compare it with the sound file's path given by openpanel, to obtain a relative path.
Well, I didn't have a complete idea of how to do it ; I only stated how I'd get started.
And i will try to get: ../samples/sound.wav I guess starting with [s2l] and some list comparing objects. Am I on the right "path"? :)
Yes, I think so.
PS: i tried opening the patch doing cd /home/athos/pd/mypatch pdextended mypatch.pd and i still get an absolute path from [gf/find_file 0]
I don't know why. Lucky you. ;)
Actually, maybe I wrote something wrong. Now I find that the problem is specifically with : pd -send "pd open find_file-help.pd gf" and even worse : pd -send "pd open gf/find_file-help.pd ."
One is not supposed to use a relative name as the $2 of "pd open", but then, it doesn't get rejected either.
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC