Hi,
it might work in this way (not tested).
SaveToFile works similar.
Delphi-Quellcode:
function TFileChecker.LoadFromFile(AFileName: string): boolean;
var
iStream:TMemoryStream;
buf: TFileSpec;
i:Integer;
begin
Result:=False;
SetLength(FFileSpec, 0);
iStream:= TMemoryStream.Create;
Try
iStream.LoadFromFile(AFileName);
setLength(FFileSpec,iStream.size div SizeOf(TFileSpec));
iStream.seek(0,soFromBeginning);
i := 0;
while iStream.Position < iStream.size do
begin
iStream.ReadBuffer(buf,sizeOf(TFileSpec));
FFileSpec[i] := buf;
inc(i);
end;
Result:=True;
finally
iStream.Free;
end;
end;
Best regards
Klaus