Directory iteration iterable
Directories are iterable through the Luart helper function each(), returning the next entry in the folder with each loop iteration. The folder must exist to iterate through its content.
Each iteration returns either a File or a Directory value
Example
-- iterate through all current directory content
for entry in each(sys.Directory(".")) do
if type(entry) == "File" then
print(entry.name)
else -- entry is a directory
print(entry.fullpath:match("\\.*\\([%w%p]+)$").."\\")
end
end