...aber dabei keine neuen Speicherlöcher erzeugen!
Delphi-Quellcode:
function GetFileSize(szFile: PChar): Int64;
var
fFile : THandle;
wfd : TWIN32FINDDATA;
begin
result := -1;
fFile := FindFirstfile(pchar(szFile), wfd);
if fFile = INVALID_HANDLE_VALUE then exit;
if (wfd.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then
result := (wfd.nFileSizeHigh * (Int64(MAXDWORD) + 1)) + wfd.nFileSizeLow;
windows.FindClose(fFile);
end;
Gruß Hawkeye