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

# readfile

> يقرأ existing regular file داخل workspace في binary mode ويعيد bytes الخاصة بها كسلسلة Lua.

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

  ## أسماء بديلة

  * `readfileasync`

  ## الوسائط

  <ParamField path={"path"} type={"string"} required>
    File path يتم حله داخل workspace بعد separator normalization و workspace-boundary checks و filename/extension checks. Absolute paths مقبولة فقط اذا كانت resolve داخل workspace.
  </ParamField>

  ## القيم الراجعة

  <ResponseField name={"content"} type={"string"}>
    File contents تعاد كسلسلة Lua بطول صريح. Bytes مثل null bytes و line endings و BOM bytes لا يتم تحويلها بواسطة readfile.
  </ResponseField>

  ## مثال

  اقرأ bytes من existing workspace file.

  ```lua theme={null}
  local path = "examples/config.json"
  writefile(path, '{"enabled":true}')

  local content = readfile(path)
  print(content)
  print(#content)
  ```
</div>
