ReferenceFilesystem

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

ParameterTypeDescription
pathstringWorkspace-relative directory; use an empty string for the root.

Returns

TypeDescription
{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.