[fpc-pascal] FindFirst FindNext

Mattias Gaertner nc-gaertnma at netcologne.de
Fri May 1 11:55:54 CEST 2009


I thought the file attributes are ignored under linux, but apparently
they are not.
Is it normal, that FindNext returns a file twice?

uses
  SysUtils;

var
  Info: TSearchRec;
begin
  if FindFirst('*',faDirectory,Info)=0 then
  begin
    repeat
      writeln(Info.Name);
    until FindNext(Info)<>0;
  end;
  FindClose(Info);
end;

With faAnyFile every file is listed only once.

Mattias



More information about the fpc-pascal mailing list