| grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » DirList(string[, string]) | Version 2.2 |
DirList 関数は、指定パスにあるファイルのテーブルを返します。返されたリストは、オプションのフィルタ引数を用いて処理できます。
showfile ディレクトリ内のショーファイルを、GetPath() 関数を用いて出力します。
Lua |
return function () -- Get the path to the show files. local path = GetPath(Enums.PathType.Showfiles) -- Make a filter to only list .show files. local filter = "*show" -- Use the DirList function to get a table of the files. local returnTable = DirList(path, filter) -- Print the information of the files in the returned table. for _, value in pairs(returnTable) do Printf(value['name'] .. " - Size: " .. value['size'] .. " bytes - Time: " .. os.date("%c", value['time'])) end end |