appendfileasync Asynchronous
Add bytes to the end of a workspace file on a background thread. It suits logs that grow while the game runs.
Luau
appendfileasync(path: string, contents: string) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Workspace-relative path of the file to extend. |
contents | string | Bytes to append. |
Returns
()No values.
Usage notes
The file work runs on a background thread, and the call always yields at least one frame, even for a small file. Filesystem failures raise in the calling thread.
Example
Luau
writefile("async-log.txt", "Started\n")
appendfileasync("async-log.txt", "Background entry\n")
print(readfile("async-log.txt"))
delfile("async-log.txt")