# 读写文件
<subtitle>在沙箱文件系统中读取和写入文件。</subtitle>

## 读取文件

您可以使用 `files.read()` 方法从沙箱文件系统读取文件。

```python
from ucloud_sandbox import Sandbox

sandbox = Sandbox.create()
file_content = sandbox.files.read('/path/to/file')
```

## 写入单个文件

您可以使用 `files.write()` 方法将单个文件写入沙箱文件系统。

```python
from ucloud_sandbox import Sandbox

sandbox = Sandbox.create()

sandbox.files.write('/path/to/file', 'file content')
```

## 写入多个文件

您也可以一次将多个文件写入沙箱。

```python
from ucloud_sandbox import Sandbox

sandbox = Sandbox.create()

sandbox.files.write_files([
    { "path": "/path/to/a", "data": "file content" },
    { "path": "another/path/to/b", "data": "file content" }
])
```
