ES3.GetFiles
Description
Gets an array of file names (and their extensions) from a directory.
Parameters
directoryPath | [Optional] The relative or absolute path of the directory we want to get the filenames from. |
settings |
[Optional] The settings we want to use to override the default settings. |
Returns
An array of file names. For example: {“file1.txt”, “file2.txt”, “file3.txt”}.
Examples
C#
1 2 3 4 5 6 7 8 9 10 11 |
// Save some files to a subdirectory of the default save directory. ES3.Save<int>("key", 123, "myDirectory/myFile1.es3"); ES3.Save<int>("key", 123, "MyDirectory/myFile2.es3"); ES3.Save<int>("key", 123, "myDirectory/myFile3.es3"); // Now get the names of the files we created and log them to console. foreach(var fileName in ES3.GetFiles("myDirectory/")) Debug.Log(fileName); // Outputs: // myFile1.es3 // myFile2.es3 // myFile3.es3 |
JS
1 2 3 4 5 6 7 8 9 10 11 |
// Save some files to a subdirectory of the default save directory. ES3.Save.<int>("key", 123, "myDirectory/myFile1.es3"); ES3.Save.<int>("key", 123, "MyDirectory/myFile2.es3"); ES3.Save.<int>("key", 123, "myDirectory/myFile3.es3"); // Now get the names of the files we created and log them to console. foreach(var fileName in ES3.GetFiles("myDirectory/")) Debug.Log(fileName); // Outputs: // myFile1.es3 // myFile2.es3 // myFile3.es3 |