소스 검색

Harden zipping compressed backup files a bit

Reinier Olislagers 11 년 전
부모
커밋
c20761fa18
2개의 변경된 파일14개의 추가작업 그리고 7개의 파일을 삭제
  1. 11 4
      backuprestore.pas
  2. 3 3
      comparison.pas

+ 11 - 4
backuprestore.pas

@@ -256,10 +256,17 @@ begin
         meLog.Lines.Add('Going to compress file ' + TempFile +
           ' as filename ' + FBKZippedFile +
           ' in zip file ' + UserFile);
-        Zipper.ZipAllFiles; //zip up all entries (just 1 in our case)
-        // Delete temp file containing fbk
-        Sleep(40); //give filesystem chance to update locks etc
-        Sysutils.DeleteFile(TempFile);
+        try
+          Zipper.ZipAllFiles; //zip up all entries (just 1 in our case)
+          // Delete temp file containing fbk
+          Sleep(40); //give filesystem chance to update locks etc
+          Sysutils.DeleteFile(TempFile);
+        except
+          on E: Exception do
+          begin
+            meLog.Lines.Add('Error compressing file. Technical details: '+E.Message);
+          end;
+        end;
       finally
         Zipper.Free;
       end;

+ 3 - 3
comparison.pas

@@ -532,7 +532,7 @@ begin
           FQueryWindow.meQuery.Lines.Add('');
         end
         else
-          FQueryWindow.meQuery.Lines.Add('-- Index ' + AIndexName + ' not exist on ' + ATableName);
+          FQueryWindow.meQuery.Lines.Add('-- Index ' + AIndexName + ' does not exist on ' + ATableName);
       end
       else
       if (ObjectType = otConstraints) and cxTables.Checked then // Constraints are part of tables
@@ -558,7 +558,7 @@ begin
           FQueryWindow.meQuery.Lines.Add('');
         end
         else
-          FQueryWindow.meQuery.Lines.Add('-- Constraint ' + ConstraintName + ' not exist on ' + ATableName);
+          FQueryWindow.meQuery.Lines.Add('-- Constraint ' + ConstraintName + ' does not exist on ' + ATableName);
       end;
     end;
   finally
@@ -871,7 +871,7 @@ begin
       COtherFieldNames:= dmSysTables.GetConstraintForeignKeyFields(COtherFieldName, dmSysTables.sqQuery);
 
     if not Exist then
-      meLog.Lines.Add(' -- Error: Constraint: ' + AConstraintName + ' not exist on table: ' + ATableName);
+      meLog.Lines.Add(' -- Error: Constraint: ' + AConstraintName + ' does not exist on table: ' + ATableName);
 
     // Compare
     if Exist then