On 10 May 2009, at 11:44, fpcl...@silvermono.co.za wrote:

Tinkering with Findfirst, Findnext functions within Linux, I discovered that the file attribute pointing to the parent dir and the curent dir (. + ..) are
missing from filutilh.inc - Am I looking in the wrong place?

I found that the following works;

procedure Test();
const
  faDirDots = $00000030; //* missing in filutilh.inc

That would simply be the logical "or" of these two constants:

  faDirectory = $00000010;
  faArchive   = $00000020;

  //* other declerations ommitted

begin
  if FindFirst('*', faAnyFile, SearchRec) = 0 then
  begin
      repeat
       //* list all files except . and ..
       if SearchRec.Attr <> faDirDots then
           Writeln(SearchRec.Name);
       until FindNext(SearchRec) <> 0;

       FindClose(SearchRec);
   end;
end;

Doesn't that simply filter out all directories?


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to