Delphi-Quellcode:
procedure Find(Str: string);
var
MySearch: TSearchRec;
FindResult: Integer;
begin
FindResult:=FindFirst(Str+'\*.*', faAnyFile, MySearch);
while FindResult=0 do
begin
if ((MySearch.Attr and faDirectory) = faDirectory) and
(MySearch.Name<>'.') and
(MySearch.Name<>'..') then
Find(Str + '\' + MySearch.Name)
else
TotalSize:=TotalSize+MySearch.Size;
FindResult:=FindNext(MySearch);
end;
SysUtils.FindClose(MySearch);
end;
...wie gesagt totalsize gibt schon die richtigen werte aus!