> ## 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.

# writefile

> workspace icindeki bir dosyaya Lua string bytes yazar, missing parent directories olusturur ve dosya zaten varsa file contents degerini degistirir.

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

  ## Aliaslar

  * `writefileasync`

  ## Argümanlar

  <ParamField path={"path"} type={"string"} required>
    separator normalization, workspace-boundary checks ve filename/extension checks sonrasinda workspace icinde cozulun File path. Absolute paths yalnizca workspace icinde resolve olursa kabul edilir.
  </ParamField>

  <ParamField path={"content"} type={"string"} required>
    Yazilacak Lua string bytes. Veri binary truncate mode ile yazilir; writefile newlines, BOM bytes, null terminators veya baska extra bytes eklemez.
  </ParamField>

  ## Örnek

  Bir workspace file icine bytes yazin ve existing contents degerlerini degistirin.

  ```lua theme={null}
  local path = "examples/config.json"

  writefile(path, '{"enabled":true}')
  print(readfile(path))

  writefile(path, "")
  print(#readfile(path))
  ```
</div>
