Поиск на винчестере
Я ищу метод или компонент, производящий поиск каких-либо файлов
на винчестере, например, (*.exe)...
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.
|
|