From Hopmod Wiki
filesystem.dir(pathname)
Directory iterator.
for filetype, filename in filesystem.dir(".") do
print(filename)
end
filesystem.DIRECTORY
File type constant.
filesystem.FIFO
File type constant.
filesystem.FILE
File type constant.
filesystem.SOCKET
File type constant.