FileSystem.findFiles(var directory, String wildcard, bool recursive)
-
@d-healey True, I checked now and after I Compiled, the array is not yet populated.
-
@Sawer
Do all files work or only text files? Because I just want to get the name of each sample file in the project sample folder, using the FileSystem API. -
@Sawer All files, but the samples won't be in the project folder on the user's system.
Do your samples have a
.format
extension?Perhaps use this function
-
@d-healey the format was just an example name: the wildcard is "*.wav"
Will try that function now and give you a feedback. Thanks -
@d-healey For instance, I'm now trying the same thing with an XML, and still the array is not populated. Strange..
-
@Sawer Need to see more of your code to know what you're doing wrong.
-
@d-healey True.
inline function fetchSamplesDirectory(component, value) { if (value == 1) FileSystem.browseForDirectory(FileSystem.Desktop, function(folder) { if(isDefined(folder) && folder.isDirectory()) { var samplesPath = folder.toString(folder.FullPath); //samples directory variable var samplesArray = FileSystem.findFiles(samplesPath, "*.wav", false); //Array of samples Console.print(samplesArray); } }); };
I have not been iterating over the array cause it's still not populated.
-
@Sawer You don't need to pass a string to the findFiles function. Just pass in the
folder
variable. -
@d-healey Genius! Thanks, David.
-
@Sawer said in FileSystem.findFiles(var directory, String wildcard, bool recursive):
@d-healey Genius!
I will go down in history as the man who read the manual :p
-
From now on you will be addressed as Sir David Healey, Slayer of Hydra Tabs and Reader of the Manual.
-
@Christoph-Hart said in FileSystem.findFiles(var directory, String wildcard, bool recursive):
From now on you will be addressed as Sir David Healey, Slayer of Hydra Tabs and Reader of the Manual.
..and Custodian of the T-Shirts
Dont forget that...