ReferenceFilesystem

appendfileasync

Appends bytes to a workspace file. It has the same arguments and result as appendfile.

Syntax

appendfileasync(path: string, data: string): ()

Parameters

ParameterTypeDescription
pathstringWorkspace-relative file.
datastringBytes to write or append.

Description

Use appendfile for the full path, error and return contract. The Async spelling does not grant access outside the workspace and does not mean that a callback argument is required. It suspends the calling thread once before running, so a thread started with task.spawn is still alive when task.spawn returns.

Example

appendfileasync("example.txt", "hello")

These are Game executor contracts. Check build requirements and session lifetimes before using them.