# Encode to a sibling partial file so failed exports never destroy an existing video · dara/icarus

[View on GitCafe](https://git.cafe/dara/icarus/commit/e671d8af842f33f459f6d6002392fd8e05843386)

Repository: [dara/icarus](https://git.cafe/dara/icarus)

Visibility: public

Requested revision: e671d8af842f33f459f6d6002392fd8e05843386

Requested commit: e671d8af842f33f459f6d6002392fd8e05843386

Commit: e671d8af842f33f459f6d6002392fd8e05843386

Tree: 4c820bb4a571d4333c72c412b2740e386c28d72a

Author: Dara Adedeji

Committer: Dara Adedeji

## Message

```
Encode to a sibling partial file so failed exports never destroy an existing video

ffmpeg's -y truncates its target immediately, so encoding straight into
the user-chosen path meant a failed or cancelled export (whose cleanup
deletes that path) destroyed any video the user had chosen to overwrite.
Encode into <output>.icarus-partial.mp4 next to the destination and only
rename it over the selected path after a successful encode; failure and
cancellation cleanup now delete only the partial file.

```

## Parents

- [2ea72df75498628e950b50e9e582e017979f0576](https://git.cafe/dara/icarus/commit/2ea72df75498628e950b50e9e582e017979f0576?format=markdown)

[Source at this commit](https://git.cafe/dara/icarus/tree/e671d8af842f33f459f6d6002392fd8e05843386?format=markdown)
