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 <[email protected]> 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 > [email protected] > https://lists.puredata.info/listinfo/pd-dev >
_______________________________________________ Pd-dev mailing list [email protected] https://lists.puredata.info/listinfo/pd-dev
