Moin...
Zitat:
List:=TStringList.Create;
...war darauf bezogen. Ich weis ja nicht, welche QT Version bei dir aktuell ist.
Delphi-Quellcode:
procedure DeleteFilesInDirectory(const Path: string);
var
I: Integer;
R: Integer;
SR: TSearchRec;
List: TStringList;
begin
List := TStringList.Create;
try
R := FindFirst(Path + '\*.*', faAnyFile, SR);
while R = 0 do
begin
if (SR.Attr and faDirectory <> faDirectory) then
begin
List.Add(Path + '\' + SR.Name);
end;
R := FindNext(SR);
end;
FindClose(SR);
for I := 0 to List.Count - 1 do
begin
DeleteFile(List[I]);
end;
finally
List.Free;
end;
end;