Parameters
string
required
The folder to list.
Returns
table
An array of contained paths.
Example
Errors
Related
isfolder: test before listing.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
List a folder’s contents.
listfiles(path: string) -> { string }
for _, path in listfiles("") do
print(path, isfolder(path) and "dir" or "file")
end
| Message | Condition |
|---|---|
argument 1 must be a string path | Argument 1 was not a string. |
that path names a file, so there is nothing to list | The path was a file. |
no folder exists at that path to list | The folder does not exist. |
isfolder: test before listing.