Syntax
listfiles(path: string): tableArguments
| Name | Type | Description |
|---|---|---|
path | string | Workspace-relative path to the file or folder. |
Returns
| Name | Type | Description |
|---|---|---|
paths | table | Array table of workspace paths found in the folder. |
Description
Lists files and folders inside a workspace directory.
Call it with 1 parameter(s): path. The argument table explains which values are required and which ones only refine the behavior.
It returns paths (table). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Enumerate files inside a workspace directory.
for _, path in ipairs(listfiles("workspace/examples")) do
print(path)
end