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