1,18 → 1,11 |
program filefind; |
Uses sysutils; |
var directory : string; |
var progname : string; |
|
// ============================================================================ |
// Functions |
// ============================================================================ |
|
procedure Usage(mesg : string); |
begin |
Writeln('Usage: ' + progname + ' directory'); |
Writeln(mesg); |
end; |
|
procedure traverse(directory : string); |
var curdir1, curdir2 : string; |
Info : TSearchRec; |
47,7 → 40,6 |
// ============================================================================ |
|
begin |
progname := ParamStr(0); |
directory := ParamStr(1); |
if (ParamCount = 1) |
then |
55,7 → 47,7 |
then |
start_traverse(directory) |
else |
Usage('ERROR: Not a directory : ' + directory) |
Writeln ('ERROR: Not a directory : ', directory) |
else |
Usage('ERROR: 1 argument expected'); |
Writeln('ERROR: Give directory as argument'); |
end. |