listfiles
Lists the immediate files and directories inside a workspace directory. It does not recursively walk descendants. Use isfile or isfolder to distinguish entry types; ordering is not a sorting guarantee.
Syntax
listfiles(path: string) -> {string}
Also available as
list_files
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Workspace-relative directory; use an empty string for the root. |
Returns
| Type | Description |
|---|---|
{string} | Paths of immediate entries. |
Description
File operations are confined to the current workspace. Absolute paths and traversal outside it are not accepted. Use a file dialog when the user needs to choose an external file.
Example
for _, path in listfiles("") do
print(path, isfolder(path))
end
These are Game executor contracts. Check build requirements and session lifetimes before using them.
