[PD] get filenames from directory

Lorenzo Sutton lorenzofsutton at gmail.com
Mon Dec 7 23:58:09 CET 2015


On 07/12/15 10:26, Simon Iten wrote:
> what would be an appropriate way to get all filenames out of a directory in pd-vanilla?
>
> i have only seen very old posts about this, they all use pd-extended. is there any recent object/external that does this?
> it could be nice if openpanel could also open a directory and output all the filenames...
>
> alternatively is there a way to just read all the files from a directory one after the other?

If you are on Linux (unix? macs?) and have Bash you could have in Pd a 
netreceive obeject e.g.:

[netreceive 6666]

Then from bash something like this (from within the dir you want to list)

echo $(ls -1 | tr "\n" ";") > /dev/tcp/127.0.0.1/6666

or like this (example to feed directly the netreceive outlet to a [list] 
object..):

echo $(find . -maxdepth 1 -type f -printf '%f ')";" > \
/dev/tcp/127.0.0.1/6666

The last one would also list hidden (i.e. 'dot') filenames

Lorenzo.



More information about the Pd-list mailing list