
21.04.2012, 22:41
|
 |
.
|
|
Регистрация: 18.05.2011
Адрес: Омск
Сообщения: 3,970
Версия Delphi: 3,5,7,10,12,XE2
Репутация: выкл
|
|
Достаточно простой пример:
Код:
function DeleteFiles(const FileMask : String) : Boolean;
var
SRec : TSearchRec;
Path : String;
begin
Result := FindFirst(FileMask, faAnyFile, SRec) = 0;
if not Result then
exit;
try
Path := ExtractFilePath(FileMask);
Repeat
if (SRec.Name <> '') and (SRec.Name <> '.') and (SRec.Name <> '..') and
(SRec.Attr and (faVolumeID + faDirectory) = 0) then
begin
Result := DeleteFile(Path + SRec.Name);
if not Result then
break;
end;
Until FindNext(SRec) <> 0;
finally
FindClose(SRec);
end;
end;
__________________
Je venus de nulle part
55.026263 с.ш., 73.397636 в.д.
|