appendfile Synchronous

  • appendfileasync

Add bytes to the end of a workspace file. It is a natural fit for a running log because existing entries stay in place.

Syntax
Luau
appendfile(path: string, contents: string) -> ()

Parameters

Function parameters
ParameterTypeDescription
pathstringWorkspace-relative file path.
contentsstringText or binary bytes to add.

Returns

()

No values.

Usage notes

Include a newline yourself when entries should be on separate lines.

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
local path = "session.log"
if not isfile(path) then writefile(path, "Session started\n") end
appendfile(path, "Settings opened\n")
Kawaii documentation