[fpc-devel] Re: FindFirst under Linux doesn't set faHidden

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Aug 16 12:04:34 CEST 2007


faSymLink also seem to never be set.  Same issue as faHidden.

Graeme.



On 16/08/07, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> Hi,
>
> As per the documentation:
>   http://lazarus-ccr.sourceforge.net/docs/rtl/sysutils/findfirst.html
> ---------------------
> faHidden
>     The file is hidden. (On unix, this means that the filename starts
> with a dot)
> -----------------------
>
> I've tried this today using FPC 2.1.5 and faHidden doesn't seem to be set, ever.
>
> Below is a list of files I tested on under Linux. I first printed the
> filename found by FindFirst/FindNext and then I printed True or False
> if the faHidden attribute was set. As you can see even for files with
> the '.' (dot) prefix, the faHidden is never set.
>
> .. FALSE
> .svn FALSE
> units FALSE
> . FALSE
> filegrid.lpr FALSE
> filegrid.lps FALSE
> filegrid.compiled FALSE
> filegrid.lpi FALSE
> filegrid FALSE
> .I_should_be_hidden FALSE
>
>
> I know unix OS's don't have a real notion of 'hidden' files, but it is
> a standard to treat dot prefix files as hidden. The FPC documentation
> mentions that and Kylix treated it like that as well.
>
> Can anybody else confirm this, before I submit a bug report?
>
> Oh, and here is the function I use to test the attribute:
>
>  // Example:  HasAttrib(sr.Attr, faHidden)  returns True if faHidden was set.
>   function HasAttrib(fileAttrib, testAttrib: Integer): Boolean;
>   begin
>     Result := (fileAttrib and testAttrib) <> 0;
>   end;
>
>
> Regards,
>   - Graeme -
>



More information about the fpc-devel mailing list