ES2.GetFiles
Get Files
Parameters
folder | The relative or absolute folder to look for files in. |
settings |
Optional. A user-created ES2Settings object containing options not specified in path. |
Returns
string[] | The list of files within this folder. |
Description
Returns the filenames of the files contained within the specified folder.
Note: This can be a relative or absolute folder.
C#
1 2 3 4 5 6 7 |
// Save three files into the same folder. ES2.Save(123, "myFolder/file1.txt"); ES2.Save(123, "myFolder/file2.txt"); ES2.Save(123, "myFolder/file3.txt"); // 'filesInFolder' will be an array containing 'file1.txt', 'file2.txt' & 'file3.txt'. string[] filesInFolder = ES2.GetFiles("myFolder/"); |
JS
1 2 3 4 5 6 7 |
// Save three files into the same folder. ES2.Save(123, "myFolder/file1.txt"); ES2.Save(123, "myFolder/file2.txt"); ES2.Save(123, "myFolder/file3.txt"); // 'filesInFolder' will be an array containing 'file1.txt', 'file2.txt' & 'file3.txt'. var filesInFolder : String[] = ES2.GetFiles("myFolder/"); |
Get Files with Extension
Parameters
folder | The relative or absolute folder to look for files in. |
extension |
If specified, only files with this extension will be returned. |
Returns
string[] | The list of files within this folder with the given extension. |
Description
Returns the filenames of the files contained within the specified folder with the specified extension.
The extension should be in the format *.txt. The extension may also be a search pattern as described here.
Note: Path can be a relative or absolute folder.
C#
1 2 3 4 5 6 7 |
// Save three files into the same folder. ES2.Save(123, "myFolder/file1.file"); ES2.Save(123, "myFolder/file2.txt"); ES2.Save(123, "myFolder/file3.txt"); // 'filesInFolder' will be an array containing 'file1.txt', 'file2.txt' & 'file3.txt'. string[] filesInFolder = ES2.GetFiles("myFolder/", "*.txt"); |
JS
1 2 3 4 5 6 7 |
// Save three files into the same folder. ES2.Save(123, "myFolder/file1.file"); ES2.Save(123, "myFolder/file2.txt"); ES2.Save(123, "myFolder/file3.txt"); // 'filesInFolder' will be an array containing 'file2.txt' & 'file3.txt'. var filesInFolder : String[] = ES2.GetFiles("myFolder/", "*.txt"); |