program filefind;
Uses sysutils;
var directory : string;
procedure traverse(directory : string);
var curdir1, curdir2 : string;
Info3 : TSearchRec;
pfile : string;
begin
curdir1 := GetCurrentDir;
chdir(directory);
curdir2 := GetCurrentDir;
FindFirst(directory + '/*', faAnyFile or faHidden, Info3);
repeat
if ((Info3.name <> '..') and (Info3.name <> '.'))
then
begin
pfile := curdir2 + '/' + Info3.name;
Writeln(pfile);
if (DirectoryExists(pfile))
then
traverse(pfile)
end
until FindNext(Info3) <> 0;
chdir(curdir1);
end;
procedure start_traverse(directory : string);
begin
Writeln(directory);
traverse(directory);
end;
begin
directory := ParamStr(1);
if DirectoryExists(directory)
then
start_traverse(directory)
else
Writeln ('Not a directory : ', directory)
end.