---
title: "appendfile"
description: "Appends bytes, creating a file and parent directories when needed."
---

```lua
appendfile(path: string, data: string): ()
```

---

## Aliases

None.

---

## Arguments

<ParamField body="path" type="string" required>
  A UTF-8 path relative to the Byte workspace.
</ParamField>

<ParamField body="data" type="string" required>
  The input bytes as a binary-safe Luau string.
</ParamField>

---

## Returns

This function returns no values.

Shares writefile's extension restrictions.

**Related types:** [Filesystem types & behavior](/reference/filesystem/types).

---

## Example

```lua
appendfile("docs-example/events.txt", "started
")
```
