I’ve been trying with PathName, File, Strings, Arrays, and routines.
I’m just trying to get all the files recursively, from within multiple folders, select the ones with a certain file extension, then do something to them,.
I’ve been through all the help files.
Doing something like this only returns the last folder in the list:
(
var endResult;
t = "C:/Users/melas/AppData/Local/SuperCollider/test/*";
t.pathMatch.do({|it,i| endResult = (it ++ "*").pathMatch.postln;});
endResult;
)
I was hoping there would be a way to just use wildcards, like
"C:/path/*/*.txt"
to only get the .txt files in the folders in a folder, but that doesn’t work.
I’m trying to collect all the files in multuple folders recursively. Like C:/folder/folder1/* and C:/folder/folder2/* etc.
As in, I have a Samples/ folder, and it has a bunch of folders in it i.e. kicks/ hats/ etc. and each has files in it. I want to get all the files in those folders in one list, and iterate over them.
For what it’s worth, PathName("").filesDo{ } is the only method in SC that will recursively iterate over every file in every subfolder for a path’s location.
Without it, solutions are apt to become complex or less reusable.