> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# appendfile

> Appends raw Lua string bytes to a workspace file using binary append mode. The file may be created if its parent folder exists.

<div className="real-function-page">
  ```lua theme={null}
  appendfile(path: string, data: string)
  ```

  ## Alias

  * `appendfileasync`

  ## Arguments

  <ParamField path={"path"} type={"string"} required>
    Path resolved inside the workspace after separator normalization and workspace-boundary checks. Empty paths, paths outside the workspace, invalid filenames, DOS device names, and blocked extensions error.
  </ParamField>

  <ParamField path={"data"} type={"string"} required>
    Lua string bytes to append. No newline or other separator is added automatically.
  </ParamField>

  ## Exemple

  Ajoute les bytes explicitement, avec ton propre newline quand tu veux une nouvelle ligne.

  ```lua theme={null}
  local path = "examples/log.txt"

  writefile(path, "first entry")
  appendfile(path, string.char(10) .. "second entry")

  print(readfile(path))
  ```
</div>
