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

# File operations

> Tutorial for uploading and downloading files to and from CoreWeave sandbox instances

```python theme={"system"}
# 쓰기 (내용은 바이트여야 함)
sandbox.write_file("/tmp/hello.txt", b"Hello!").result()

# 읽기 (bytes 반환)
content = sandbox.read_file("/tmp/hello.txt").result()
print(content.decode())
```

`exec()`와 마찬가지로 파일 오퍼레이션은 완료를 기다리지 않고 즉시 `OperationRef`를 반환합니다. 데이터가 필요할 때 `.result()`를 호출하세요. 이렇게 하면 여러 오퍼레이션을 시작해 두고 한꺼번에 기다릴 수 있습니다.

```python theme={"system"}
refs = [sandbox.write_file(f"/tmp/{i}.txt", b"data") for i in range(5)]
for ref in refs:
    ref.result()
```

병렬 업로드 및 다운로드 패턴과 S3 마운트에 대해서는 [파일 오퍼레이션 가이드](/ko/products/sandboxes/client/guides/file-operations)를 참조하세요.
