Einzelnen Beitrag anzeigen

Benutzerbild von dahead
dahead

Registriert seit: 16. Mai 2005
620 Beiträge
 
#11

Re: Eindeutiger Vergleich für große Dateien gesucht

  Alt 3. Aug 2005, 10:59
hallo,

ja, das mit .Read ist mir jetzt klar (s. oben).

1.) GetFileSize speichere ich bereits als Int64.
2.) ok, werde ich einbauen.
3.) ok
4.) ja, so habe ich mir das auch gedacht. ich muss jetzt nur aus diesen beiden prozeduren (FilesAreBinaryEqual u. TMemoryMappedFile.Create) eine basteln, die das besagte problem löst.

das mit den 64 kb blöcken ist ebenfalls logisch, wie du siehst habe ich ja auch in der TFileStream variante daten in dieser block größe eingelesen.

D.h. man sollte die Buffergröße inkrementell so lange erhöhen bis sich die größte Performance pro Byte ergibt. ja, das wäre am besten.

aus der msdn:
Zitat:
dwFileOffsetLow: A low-order DWORD of the file offset where the view is begins. The combination of the high and low offsets must specify an offset within the file that matches the memory allocation granularity of the system, or the function fails. That is, the offset must be a multiple of the allocation granularity. To obtain the memory allocation granularity of the system, use the GetSystemInfo function, which fills in the members of a SYSTEM_INFO structure.
d.h. ich muss erst ermitteln, welchen wert das jeweilige system überhaupt zulässt.

edit:

Delphi-Quellcode:
function GetSystemAllocationGranularity: Cardinal;
var
  PSysInfo: TSystemInfo;
begin
  GetSystemInfo(PSysInfo);
  Result := PSysInfo.dwAllocationGranularity;
end;
  Mit Zitat antworten Zitat