isfile Synchronous
Ask whether a workspace path names an existing file. It is a quick way to make optional data truly optional before calling readfile.
Luau
isfile(path: string) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
path | string | Workspace-relative path to check. |
Returns
booleantrue for an accessible file; false otherwise.
Usage notes
A folder is not a file. false is not a detailed diagnostic for why a path cannot be opened.
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
local path = "settings.json"
if isfile(path) then
print("Loaded", #readfile(path), "bytes")
end