You could use the io.popenfunction to run a OS command, in linux you can run ls -1 then get the output of the executed command.
io.popen
ls -1
local files = io.popen("ls -1")
the -1 is to list only the file names per line