[PD] browsing and selecting a folder (directory)

Matteo Sisti Sette matteosistisette at gmail.com
Wed Dec 9 15:22:40 CET 2009


It may be quite simple but, now that it's done...

I attach a [lastindexof] abstraction (which uses a [truncatesymbol] 
abstraction also attached) which searches for the last occurrence of a 
given character in a symbol.
I use it to search for the last occurrence of "/" in a full path, in 
order to separate the path from the file name.

It takes the character to look for in the right inlet (as symbol), or as 
a creation argument. When input a symbol in the left inlet, it outputs 
the index of the last occurrence of the given character, or -1 if it is 
not present.

It can be easily modified to search for the _first_ occurrence 
([indexof]) and it should not be difficult to modify it so that the 
searched symbol could be of any length (mantaining the same 
computational inefficiencies it has now)

I am a vanilla purist (no disrespect at all to pd-extended)...

Ah, the [truncatesymbol] abstraction, which is basically a settable 
[makefilename %.$1s], also manages the case of 0 characters by returning 
a null symbol.

Dunnow if it will be of any use to anybody.....

bye
m.

-- 
Matteo Sisti Sette
matteosistisette at gmail.com
http://www.matteosistisette.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lastindexof.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20091209/37b9a3de/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: truncatesymbol.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20091209/37b9a3de/attachment.asc>


More information about the Pd-list mailing list