isfile Synchronous

Check whether a workspace path points to an existing file. Use it before reading optional data or to distinguish files from folders in a directory listing. A false result means the path is not an accessible file under the workspace rules; it is not a detailed explanation of why access failed.

Syntax
Luau
isfile(path: string) -> boolean

Parameters

Function parameters
ParameterTypeDescription
pathstringPath inside the Kawaii workspace, for example settings/theme.json.

Returns

boolean

true for a regular file; false for a folder, a missing path, or a path rejected by the filesystem.

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 isfile("preferences.json") then
    local settings = json.decode(readfile("preferences.json"))
    print(settings.theme)
end
Kawaii documentation