[fpc-pascal] Missing File attribute in filutilh.inc?

fpclist at silvermono.co.za fpclist at silvermono.co.za
Sun May 10 12:25:13 CEST 2009


On Sunday 10 May 2009 11:54:01 Jonas Maebe wrote:
> On 10 May 2009, at 11:44, fpclist at 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?

Sure It does, I would still prefer to have a unique atrribute.
>
>
> Jonas
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list