Redesigned and Simplified

FindFirst, FindNext, FindClose works the same everywhere.

Designed to work like it did in DOS

Modern Pascal's FindFirst, FindNext and FindClose methods work exactly like it did in 1990.

Web Script, StandAlone or Command Line

Modern Pascal makes working with the file system as easy as it every was.

SearchRec uses methods now

SearchRecIsDirectory() handles Symbolic Links, SearchRecTime() is a Unix TimeStamp now.

Program DisplayAllFiles.v1180922; uses Environment, Datetime, Strings, Display; var SRec:SearchRec; Err:Longint; Begin ClrScr; Err:=FindFirst({$IFDEF UNIX}'/*'{$ELSE}'C:\*.*'{$ENDIF}, faAnyFile, SRec); While Err=0 do begin If SearchRecIsDirectory(SRec) then begin TextColor(10); end else begin TextColor(14); End; Write(PadRight(SearchRecName(SRec),18)); TextColor(11); Write(PadLeft(IntToCommaStr(SearchRecSize(SRec)),10)+' '); TextColor(12); Writeln(FormatTimestamp('mm/dd/yyyy hh:nn',SearchRecTime(SRec))); Err:=FindNext(SRec); End; FindClose(SRec); End.

Output from code above...