zaibatzuka
asked on
D1:Recursiv deletion of directories and content
How can I delete a directory with contents, including subdirectories in Delphi 1.0 (Windows 3.11) ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK. Note that the line above Application.ProcessMessage s is missing a left braces. Indentations would have made it easier to follow the code.
Thanks.
Thanks.
hey a html memo is sumthing else then the borland delphi UI
=)
=)
1. Look for a component which does recursif searching.
(enough freeware components on the net)
2. Delete every founded file or directory
Here is already a code for searchin the entire disk. Easely changed in searching through one directory.
unit Audit1;
interface
uses windos;
var
dest:string;
procedure dorecurse(dir:string);
implementation
{$R *.DFM}
Procedure Process (dir:string; Searchrec:tsearchrec);
begin
showmessage (Searchrec.name);
case Searchrec.attr of
$10:
if (searchrec.name<>'.') and (searchrec.name<>'..') then
begin
dorecurse (dir+'\'+searchrec.name);
writeln (dir);
end;
end;
end;
Procedure Dorecurse(dir:string);
var
Searchrec:Tsearchrec;
pc: array[0..79] of Char;
begin
StrPCopy(pc, dir+'\*.*');
FindFirst(pc, FaAnyfile, SearchRec);
Process (dir,SearchRec);
while FindNext(SearchRec)<>-18 do
begin
Process (dir,SearchRec);
end;
end;
Procedure startsearch;
begin
dorecurse (paramstr(1));
end;
begin
startsearch;
end.
Have fun,
c.u. ZifNab;