Notch Notch Manual 0.9.23
 Light | Dark
GetDirectoryFileList()

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_directoryThe path to the directory to list the files.
search_filterThe 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);
    }
}