GetDirectoryFileList()
Purpose #
Gets the list of files within a given directory based on an optional search filter.
Syntax #
bool GetDirectoryFileList(String path_to_directory, String search_filter);
Parameters
path_to_directory | The path to the directory to list the files. |
search_filter | The search filter to use. For example, "*.*" or "*.txt". |
Example #
function Update()
{
var listOfFiles = GetDirectoryFileList("C:\\myFolder\\", "*.txt");
for(i = 0; i < listOfFiles.length; ++i)
{
var pathToFile = listOfFiles[i];
Log("Filename: " + pathToFile);
}
}