File systemReference
listfiles
List immediate children of a workspace folder.
Details#
List immediate children of a workspace folder. A 1-based array of relative file and folder paths. No recursive traversal or ordering guarantee. Missing folders raise an error.
Signature#
listfiles(path: string?): {string}Parameters#
| Parameter | Type | Description |
|---|---|---|
pathoptional | string | Relative folder; omitted, nil or empty string selects the workspace root. |
Returns#
A 1-based array of relative file and folder paths. No recursive traversal or ordering guarantee. Missing folders raise an error.
Examples#
Local example
makefolder("docs-example")
for _, path in ipairs(listfiles("docs-example")) do
print(path)
end