ES3.GetFiles

public static string[] GetFiles(string directoryPath, ES3Settings settings)

Description

Gets an array of file names (and their extensions) from a directory.

Parameters

[table th=”0″]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.”[/table]

Returns

An array of file names. For example: {“file1.txt”, “file2.txt”, “file3.txt”}.

Examples

C#

// 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

// 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