How can I get a list of all files in a given local directory (standalone player)?
For instance, I have a "characters" folder that goes inside my app directory, and I would like to be able to get a list of all XML (or whatever) files in that folder at runtime to parse through.
ANSWER UPDAtE 2015 ERICS ANSWER IS NOT CURRENT SYNTAX>…
YES THIS IS CURRENT ANSWER YOU SAW THAT HAHA
function Start () {
GetFiles();
// var filePaths : String[] = Directory.GetFiles(info);
// for (file in filePaths) print (file);
}
or
function GetFiles(){
var info :String = Application.dataPath + "/AudioWave/";
var fileInfo =Directory.GetFiles(info);
for (file in fileInfo) print (file);
}
System.IO.Path.GetFileName(fullPath)
to get the name of only the file from string… fullpath string.