isfolder Synchronous

Check whether a workspace path points to an existing folder. This is useful before listing a directory or when separating folders from files. Use listfiles after this check when you need the folder contents. A path pointing to a file is false even if that file exists.

Syntax
Luau
isfolder(path: string) -> boolean

Parameters

Function parameters
ParameterTypeDescription
pathstringWorkspace-relative folder path to check. An empty string refers to the workspace root.

Returns

boolean

true for a folder; false for a file, a missing path, or a rejected path.

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

Example
Luau
if isfolder("preferences") then
    for _, path in ipairs(listfiles("preferences")) do
        print(path)
    end
end
Kawaii documentation