---
title: "Files"
description: "Write, read, list, move and delete files in a sandbox."
---

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

# Files

Every sandbox has a file system you can use from your code without running a process. Relative paths are in the sandbox's home folder.

## What you can do

| Task | Call |
| --- | --- |
| Write a file | `write` |
| Read a file | `read` for bytes, `readText` for text |
| List a folder | `list`, with page tokens for large folders |
| Get the size, type and mode of a path | `info` |
| Create a folder | `mkdir` |
| Move or rename | `move` |
| Copy | `copy` |
| Delete | `delete`, with `recursive` for a folder |
| Upload many files at once | `uploadArchive`, which unpacks a tar archive into a folder |
| Download several paths | `downloadArchive`, which returns a tar archive |

The calls work while the sandbox is running. Files on the sandbox's disk last as long as the sandbox does, unless it is stopped and keeps only its volumes. To keep files beyond that, write them to a [volume](https://docs.jgcp.mistrivedev.com/sandboxes/volumes/).

:::note[Today]
Today the SDK calls have different names: `writeObject`, `downloadFile`, `listFiles`, `getFileInfo`, `createFolder`, `move`, `copy`, `deleteFile`, `uploadArchive` and `downloadArchive` (`write_object` and so on in Python). A string passed to `writeObject` is read as a local file path, so pass content as a `Buffer` in TypeScript or `bytes` in Python.

Files and folders these calls create belong to the sandbox user, `anchor`, and folders created on the way to a path get the mode `0755`. `fs.search` and `fs.replace` are bounded by `maxFiles` and `maxBytes`, not by a time limit. The calls need a running sandbox.
:::

Source: https://docs.jgcp.mistrivedev.com/sandboxes/files/index.mdx
