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

# Work with files

> Read, write, list, and move files in a sandbox — and when to move bulk data another way.

```python theme={null}
sb.files.write("/app/config.json", data)   # creates parent dirs
text  = sb.files.read("/app/out.txt")
blob  = sb.files.read_bytes("/app/plot.png")
names = sb.files.list("/app")
sb.files.exists("/app/done")               # -> bool
```

One noun for all file work: `write / read / read_bytes / list / remove / rename / mkdir / exists`.
`remove` is recursive; `write` creates parent directories.

## Sharp edges

4 MiB per `write` call (chunk bigger payloads), 16 MiB per read
(the exec output cap; `read_bytes` is base64 under the hood). For bulk data,
download inside the sandbox (`sb.run("curl -O …")`) instead of pushing it
through the API.
