Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-05

Missing File attribute in filutilh.inc?

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi guys

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
   //* 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;

Regards
Nino

Jonas Maebe
to Unknown author
Show quoted text 11 lines
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;
Show quoted text 14 lines
//* 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

Unknown author
to Jonas Maebe: That would simply be the logical "or" of these two constants: faDirectory = $00000010;…
Jonas Maebe wrote 34 lines
On 10 May 2009, at 11:44, 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.

Show quoted text 6 lines
Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Unknown author
to Michael Van Canneyt: I never heard of this attribute. Where did you get that from ? Michael.
Michael Van Canneyt wrote 8 lines
On Sun, 10 May 2009, wrote: > Hi guys > > 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 never heard of this attribute. Where did you get that from ?

Sorry if I missled anybody. I am asking whether an attribute with the specific functionality exists. I would prefer a unique atribute as opposed to or'ing multiple attributes - at least in this case.

Show quoted text 5 lines
Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal