appendfile

Appends data to a file in Workspace.

Syntax

Signature
appendfile(Path: string, Data: string) -> ()

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
PathstringPath relative to the sandboxed Workspace.
DatastringInput bytes; binary strings are supported.

Returns

TypeDescription
()None.

Notes

The resulting file cannot exceed 16 MiB.

Example

Luau
local Path = "Examples/Log.txt"
writefile(Path, "Session started\n")
appendfile(Path, "First action\n")
appendfile(Path, "Second action\n")

print(readfile(Path))