Exit GetFileName

GetFileList


The GetFileList function returns a table containing the names of files in a folder. The names are included if they match a specified template.

Syntax

nFiles = GetFileList( sFolder, sTemplate, Table )

    sFolder is the folder to search.

    sTemplate is the name pattern to match.

    sTable is a table to which the filenames will be added.

    On success, nFiles > 0 and Table contains an array of strings.

    On failure, nFiles=0.

Remarks

This function creates a table that can be parsed using the Lua pairs function, as shown below. The names do no unpack in any "nice" order, s alphabetical. Also see the CFindFiles class for a more powerful way of loading files from a folder.

Example

Related Topics

CFindFiles , GetFolder, GetFileName