LoadFromFile(FileName: String);
FileName. The file that contains a list of the repository objects that are checked and their checksums.
The LoadFromFile method loads from the file and verifies checksums of repository objects.
Executing the example requires the control.crc file that contains a list of repository objects and their checksums in the root of the C disc.
Sub UserProc;
Var
MB: IMetabase;
CheckList: IMetabaseCheckList;
ListItem: IMetabaseCheckListItem;
Begin
MB := MetabaseClass.Active;
CheckList := MB.CreateCheckList;
CheckList.LoadFromFile("c:\control.crc");
For Each ListItem In CheckList Do
Debug.Write("Identifier: " + ListItem.Id);
Debug.Write(". Hash code: " + ListItem.Hash);
Debug.Write(". State:");
Select Case ListItem.Status
Case MetabaseCheckStatus.Identical: Debug.WriteLine(" - Object is identical");
Case MetabaseCheckStatus.Different: Debug.WriteLine(" - Objects differ");
Case MetabaseCheckStatus.Absent: Debug.WriteLine(" - Object is absent in repository");
End Select;
End For;
End Sub UserProc;
After executing the example the checksums of the repository objects, the list of which is contained in the specified file are checked. Identifier of the objects, the hash code and the result of checksums comparison are displayed in the development environment console.
See also: