Вниз
Скачать: CL | DM;

Как очистить папку Temp   Найти похожие ветки 

← →
Lagutin Anton   (2002-04-28 04:30) [0]

Please, подскажите как очистить папку Темр


← →
Anatoly Podgoretsky ©   (2002-04-28 08:49) [1]

DeleteFile


← →
Song ©   (2002-04-28 09:59) [2]

В FAQ есть пример


← →
VEG ©   (2002-04-28 11:21) [3]

function DeleteDir(Dir : string) : boolean;
Var
Found : integer;
SearchRec : TSearchRec;
begin
result:=false;
if IOResult<>0 then ;
ChDir(Dir);
if IOResult<>0 then begin
ShowMessage("Не могу войти в каталог: "+Dir); exit;
end;
Found := FindFirst("*.*", faAnyFile, SearchRec);
while Found = 0 do
begin
if (SearchRec.Name<>".")and(SearchRec.Name<>"..") then
if (SearchRec.Attr and faDirectory)<>0 then begin
if not DeleteDir(SearchRec.Name) then exit;
end else
if not DeleteFile(SearchRec.Name) then begin
ShowMessage("Не могу удалить файл: "+SearchRec.Name); exit;
end;
Found := FindNext(SearchRec);
end;
FindClose(SearchRec);
ChDir(".."); RmDir(Dir);
result:=IOResult=0;
end;


Для кнопочки:
var
s1 : array[0..254] of Char;
begin
GetWindowsDirectory(s1,255);
DeleteDir(s1+"\TEMP\");
end;


← →
Song ©   (2002-04-28 14:59) [4]

2VEG © (28.04.02 11:21)
Зачем +"\TEMP\" приписал? :))))


← →
Севостьянов Игорь ©   (2002-04-29 12:33) [5]

Это точно вот функции из unit FileUtil

GetSystemDir: string;
GetWindowsDir: string;
GetTempDir: string;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.009 c
7-39876
Brand
2001-11-08 01:02
2002.05.13
IP сетевой платы


1-39709
Reticent
2002-04-29 17:30
2002.05.13
TStringList


1-39764
Makss
2002-04-27 21:46
2002.05.13
Ресурсы!!! Помогите кто знает!!


3-39676
борисыч
2002-04-18 07:50
2002.05.13
Есть подозрение, что многопоточность BDE, IBX - миф.


6-39807
Di_wind
2002-02-22 23:26
2002.05.13
Arp




   Наверх