---
title: Copy a file to another location
description: "Copy a file to another path by passing a `BunFile` as the data argument of `Bun.write()`."
sidebarTitle: Copy file
mode: center
---

Use [`Bun.write()`](/runtime/file-io#writing-files-bunwrite) to copy a file to another location on disk. The first argument is a _destination_, like an absolute path or `BunFile` instance. The second argument is the _data_ to write.

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

---

See [`Bun.write()`](/runtime/file-io#writing-files-bunwrite).
