# File System
<subtitle>Manage files and directories in an isolated sandbox environment, supporting various read/write and synchronization operations.</subtitle>

>
> **Prerequisites**: Please complete [API Key Configuration](/docs/agent-sandbox/product/01-prerequisites) first.

Each sandbox has an independent, isolated file system designed for Agent's temporary computing tasks. Through the file system API, you can efficiently manage input data, output results, and intermediate task files.

## Core Features

Through the SDK, you can perform the following operations:

*   **[Read and Write Files](/docs/agent-sandbox/sdk/filesystem/02-read-and-write)**: Directly write text or byte data, and read file contents.
*   **[View Metadata](/docs/agent-sandbox/sdk/filesystem/03-file-and-directory-metadata)**: Retrieve file size, permissions, and modification time.
*   **[Directory Monitoring](/docs/agent-sandbox/sdk/filesystem/04-watch-directory-for-changes)**: Monitor any file changes in the directory in real-time (similar to `inotify`).
*   **[Data Upload](/docs/agent-sandbox/sdk/filesystem/05-upload-data)**: Batch transfer local files or binary streams to the sandbox.
*   **[Data Download](/docs/agent-sandbox/sdk/filesystem/06-download-data)**: Retrieve generated result files from the sandbox.

## Quick Start

```python
from ucloud_sandbox import Sandbox

sandbox = Sandbox.create()

# Quick write and verify
sandbox.files.write("hello.txt", "UCloud Sandbox is awesome!")
content = sandbox.files.read("hello.txt")
print(content) # Output: UCloud Sandbox is awesome!
```

---

>
> **Default Root Directory**: Most operations are performed under `/home/user` by default. For custom templates, please ensure your Agent has sufficient read/write permissions for the target path.
