[fpc-pascal] Missing File attribute in filutilh.inc?
Jonas Maebe
jonas.maebe at elis.ugent.be
Sun May 10 11:54:01 CEST 2009
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?
Jonas
More information about the fpc-pascal
mailing list