Directory - Mjdgithuber/AstroCorps GitHub Wiki

Directory

Directory is a usertype designed to allow you to navigate through directories relative to the project's files. It is simple and powerful to use.

-- define a new instance of directory
local dir = Directory.new('some/path/')

print(dir:is_open()) -- was it opened correctly
print(dir:number_of_files()) -- # of files in directory
print(dir:get_filename(2)) -- gets the 3rd file in directory

-- open a new directory
dir:open_dir(some/other/directory)