# replaceFile

<!-- https://uncage.vercel.app/docs/api/agent/functions/replacefile/ -->

```ts
function replaceFile(
   tmp, 
   dest, 
   o?
): Promise<void>;
```

Defined in: agent/src/perms.ts:90

Atomically replaces `dest` with `tmp`. Windows: retries `EPERM` / `EBUSY` / `EACCES` (an antivirus
scan or an open reader briefly holds the file) 10 times, 50 ms apart.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `tmp` | `string` |
| `dest` | `string` |
| `o?` | \{ `platform?`: `Platform`; `rename?`: (`a`, `b`) => `Promise`\<`void`\>; \} |
| `o.platform?` | `Platform` |
| `o.rename?` | (`a`, `b`) => `Promise`\<`void`\> |

## Returns

`Promise`\<`void`\>
