listfiles Synchronous
List the immediate children of a workspace directory. The returned paths can be handed directly to isfile, readfile, or the other workspace functions.
Luau
listfiles(path: string) -> {string}Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Workspace-relative directory to list. |
Returns
{string}An array of workspace-relative child paths.
Usage notes
This is one directory level. To descend further, call listfiles on returned paths for which isfolder is true.
Differences from Volt
Volt documents access through explicitly created workspace symlinks. Kawaii rejects symlinks in workspace paths; all workspace operations remain subject to its path containment checks.
Example
Luau
makefolder("example-settings")
for _, path in ipairs(listfiles("example-settings")) do
print(isfolder(path) and "folder" or "file", path)
end