From SCAR Divi Manual
function DeleteFile(const FileName: string): Boolean;
SCAR Divi 3.25 > Current
Deletes a file given by FileName and returns true if the file exists and was successfully deleted. If FileName is an invalid path, the function will throw an exception and stop the script.
begin CloseFile(RewriteFile(LogsPath + 'test.tmp', False)); DeleteFile(LogsPath + 'test.tmp'); end.