Hi FN10,
You can use the Directory.list()
iterator or directly by iterating through a Directory
instance :
Example that iterates through a Directory
instance
-- Produces a list of strings that contains folder filenames/subfolder names
local list = { }
for entry in each(sys.Directory("C:\\")) do
list[#list+1] = entry.name
end
Example that iterates with the Directory:list()
method
-- Produces a list of strings that contains folder filenames/subfolder names starting with 's'
local list = { }
for entry in each(sys.Directory("C:\\"):list("s*") do
list[#list+1] = entry.name
end