説明
The DirList Lua function returns a table of files at a specified path.
The returned list can be filtered using an optional filter argument.
引数
- string:
The desired path in a string format.
- string (オプション):
The optional filter string. The * can be used as a wildcard in the string. See the example below.
戻り値
- table:
The returned table has elements of other tables. Each of these table elements has the following keys:
- name: The name of the file. The value of name is returned as a string.
- size: The size of the file in bytes. The value of size is returned as a number.
- time: The timestamp for the file. The value of time is returned as a number.
例
This example prints the show files in the showfile directory.
It uses the .
|
return function () local path = GetPath(Enums.PathType.Showfiles) local filter = "*show" local returnTable = DirList(path, filter)
for _, value in pairs(returnTable) do Printf(value['name'] .. " - Size: " .. value['size'] .. " bytes - Time: " .. os.date("%c", value['time'])) end end |