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

# 将文件复制到另一个位置

使用 [`Bun.write()`](/runtime/file-io#writing-files-bun-write) 将文件复制到磁盘上的另一个位置。第一个参数是*目标*，例如绝对路径或 `BunFile` 实例。第二个参数是要写入的*数据*。

```ts theme={null}
const file = Bun.file("/path/to/original.txt");
await Bun.write("/path/to/copy.txt", file);
```

***

参见 [`Bun.write()`](/runtime/file-io#writing-files-bun-write)。
