Hi folks, I want to solicit opinions from the broader Pd dev community before figuring out how to fix this bug report from Alex: https://github.com/iainctduncan/scheme-for-pd/issues/15
His point was that a relative path didn't do what he expected, situation - an s4pd object created as "sp4d scm/my-file.scm"
So this is what I think should happen for file searching, but will change my mind if it is not in accordance with what users would expect. The handling rules will be the same whether from a a "read {file}" message or an arg to the object:
Proposed Rules: - absolute paths - opened - single file name paths: - first look in the canvas directory - then search all Pd paths - relative path names (i.e. "s4pd scm/foo.scm"): - search in the canvas directory - do *not* traverse through all directories on the Pd search paths
Does that sound right? Or would the expectation be that it would search for scm/foo.js on all the search paths?
Related, should it know how to do the right thing to convert unix style paths on windows?
Please feel free to comment here or on the github ticket.
thanks iain
the functions "canvas_open()" and "canvas_makefilename()" can do all this for you, in the same way as other data files (texts, arrays, wavs...) are opened.
- do *not* traverse through all directories on the Pd search paths
why not? Is it a problem if it finds "scm/foo.scm" somewhere else? I say that because "canvas_open()" and "canvas_makefilename()" WILL traverse Pd search paths...
Antoine
Le ven. 8 oct. 2021 à 17:01, Iain Duncan iainduncanlists@gmail.com a écrit :
Hi folks, I want to solicit opinions from the broader Pd dev community before figuring out how to fix this bug report from Alex: https://github.com/iainctduncan/scheme-for-pd/issues/15
His point was that a relative path didn't do what he expected, situation
- an s4pd object created as "sp4d scm/my-file.scm"
So this is what I think should happen for file searching, but will change my mind if it is not in accordance with what users would expect. The handling rules will be the same whether from a a "read {file}" message or an arg to the object:
Proposed Rules:
- absolute paths - opened
- single file name paths:
- first look in the canvas directory
- then search all Pd paths
- relative path names (i.e. "s4pd scm/foo.scm"):
- search in the canvas directory
- do *not* traverse through all directories on the Pd search paths
Does that sound right? Or would the expectation be that it would search for scm/foo.js on all the search paths?
Related, should it know how to do the right thing to convert unix style paths on windows?
Please feel free to comment here or on the github ticket.
thanks iain _______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Thanks Antoine, re my last point: if the norm is that it should, then that's what I'll do. And is why I asked, thanks!
iain
On Fri, Oct 8, 2021 at 8:44 AM Antoine Rousseau antoine@metalu.net wrote:
the functions "canvas_open()" and "canvas_makefilename()" can do all this for you, in the same way as other data files (texts, arrays, wavs...) are opened.
- do *not* traverse through all directories on the Pd search paths
why not? Is it a problem if it finds "scm/foo.scm" somewhere else? I say that because "canvas_open()" and "canvas_makefilename()" WILL traverse Pd search paths...
Antoine
Le ven. 8 oct. 2021 à 17:01, Iain Duncan iainduncanlists@gmail.com a écrit :
Hi folks, I want to solicit opinions from the broader Pd dev community before figuring out how to fix this bug report from Alex: https://github.com/iainctduncan/scheme-for-pd/issues/15
His point was that a relative path didn't do what he expected, situation
- an s4pd object created as "sp4d scm/my-file.scm"
So this is what I think should happen for file searching, but will change my mind if it is not in accordance with what users would expect. The handling rules will be the same whether from a a "read {file}" message or an arg to the object:
Proposed Rules:
- absolute paths - opened
- single file name paths:
- first look in the canvas directory
- then search all Pd paths
- relative path names (i.e. "s4pd scm/foo.scm"):
- search in the canvas directory
- do *not* traverse through all directories on the Pd search paths
Does that sound right? Or would the expectation be that it would search for scm/foo.js on all the search paths?
Related, should it know how to do the right thing to convert unix style paths on windows?
Please feel free to comment here or on the github ticket.
thanks iain _______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev
Thanks Antoine, using canvas_open has fixed my issues and opening from sub-dirs is working properly as well now.
iain
On Fri, Oct 8, 2021 at 8:55 AM Iain Duncan iainduncanlists@gmail.com wrote:
Thanks Antoine, re my last point: if the norm is that it should, then that's what I'll do. And is why I asked, thanks!
iain
On Fri, Oct 8, 2021 at 8:44 AM Antoine Rousseau antoine@metalu.net wrote:
the functions "canvas_open()" and "canvas_makefilename()" can do all this for you, in the same way as other data files (texts, arrays, wavs...) are opened.
- do *not* traverse through all directories on the Pd search paths
why not? Is it a problem if it finds "scm/foo.scm" somewhere else? I say that because "canvas_open()" and "canvas_makefilename()" WILL traverse Pd search paths...
Antoine
Le ven. 8 oct. 2021 à 17:01, Iain Duncan iainduncanlists@gmail.com a écrit :
Hi folks, I want to solicit opinions from the broader Pd dev community before figuring out how to fix this bug report from Alex: https://github.com/iainctduncan/scheme-for-pd/issues/15
His point was that a relative path didn't do what he expected, situation
- an s4pd object created as "sp4d scm/my-file.scm"
So this is what I think should happen for file searching, but will change my mind if it is not in accordance with what users would expect. The handling rules will be the same whether from a a "read {file}" message or an arg to the object:
Proposed Rules:
- absolute paths - opened
- single file name paths:
- first look in the canvas directory
- then search all Pd paths
- relative path names (i.e. "s4pd scm/foo.scm"):
- search in the canvas directory
- do *not* traverse through all directories on the Pd search paths
Does that sound right? Or would the expectation be that it would search for scm/foo.js on all the search paths?
Related, should it know how to do the right thing to convert unix style paths on windows?
Please feel free to comment here or on the github ticket.
thanks iain _______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at https://lists.puredata.info/listinfo/pd-dev