Don't delete output file until/unless new output generated

Scrivener (Windows)

If one intends to overwrite an existing file, but accidentally selects for compile something that produces no output, Scrivener says no output was produced, but the existing file has already gone.

It would be nice if it waited until it knew there was going to be something to save, e.g. open a temp file for output and only delete the original and rename the temp file if something gets written to it.