mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 09:29:35 +02:00
44 lines
698 B
ObjectPascal
44 lines
698 B
ObjectPascal
{%norun}
|
|
{%neededafter}
|
|
|
|
program dols;
|
|
|
|
{$mode objfpc}
|
|
|
|
uses sysutils;
|
|
|
|
var
|
|
Idx,Count : integer;
|
|
Dir : String;
|
|
Info : TSearchRec;
|
|
Long : Boolean;
|
|
|
|
|
|
begin
|
|
Dir:=GetCurrentDir;
|
|
Idx:=1;
|
|
if ParamStr(Idx)='-l' then
|
|
begin
|
|
Inc(Idx);
|
|
Long:=True;
|
|
end;
|
|
if ParamStr(Idx)<>'' then
|
|
Dir:=ParamStr(Idx);
|
|
Dir:=IncludeTrailingPathDelimiter(Dir);
|
|
Count:=0;
|
|
If FindFirst(Dir+AllFilesMask,faAnyFile,Info)=0 then
|
|
try
|
|
Repeat
|
|
if Long then
|
|
Write(Info.Size:14,' ',DateTimeToStr(Info.TimeStamp));
|
|
Writeln(Info.Name);
|
|
Inc(Count);
|
|
Until FindNext(Info)<>0;
|
|
|
|
finally
|
|
FindClose(Info);
|
|
end;
|
|
Writeln('Total: ',Count);
|
|
end.
|
|
|