Method DeleteIfExistsSafe
DeleteIfExistsSafe(string)
Deletes the specified file if it exists in a safe manner.
public static bool DeleteIfExistsSafe(string pathToFile)
Parameters
pathToFile
stringThe path to the file to be deleted.
Returns
- bool
true
if the file was successfully deleted or did not exist; otherwise,false
if an exception occurred during the deletion process.