refactor checkIfFileWasDeleted
This commit is contained in:
parent
2b4019d7cf
commit
7d7e9bac6c
@ -203,19 +203,20 @@ public class ChksumUtils {
|
|||||||
while (reader.Read()) {
|
while (reader.Read()) {
|
||||||
pathToFile = reader.GetString(0);
|
pathToFile = reader.GetString(0);
|
||||||
|
|
||||||
if (!File.Exists(pathToFile)) {
|
if (File.Exists(pathToFile)) {
|
||||||
var deleteCommand = connection.CreateCommand();
|
continue;
|
||||||
deleteCommand.CommandText =
|
|
||||||
@"
|
|
||||||
DELETE FROM file
|
|
||||||
WHERE pathtofile = $pathtofile
|
|
||||||
";
|
|
||||||
deleteCommand.Parameters.AddWithValue("$pathtofile", pathToFile);
|
|
||||||
deleteCommand.ExecuteNonQuery();
|
|
||||||
|
|
||||||
Console.WriteLine("File deleted:");
|
|
||||||
Console.WriteLine($"\t{pathToFile}\n");
|
|
||||||
}
|
}
|
||||||
|
var deleteCommand = connection.CreateCommand();
|
||||||
|
deleteCommand.CommandText =
|
||||||
|
@"
|
||||||
|
DELETE FROM file
|
||||||
|
WHERE pathtofile = $pathtofile
|
||||||
|
";
|
||||||
|
deleteCommand.Parameters.AddWithValue("$pathtofile", pathToFile);
|
||||||
|
deleteCommand.ExecuteNonQuery();
|
||||||
|
|
||||||
|
Console.WriteLine("File deleted:");
|
||||||
|
Console.WriteLine($"\t{pathToFile}\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user