Use safeRenameFile to overwrite existing files