How to not delete a file if it wasn't generated ?