Sign in Join

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

Mailing lists / fpc-devel / 2007-08

FindFirst under Linux doesn't set faHidden

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

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 -

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys

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

Graeme.

Graeme Geldenhuys wrote 47 lines
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 -

Reply by email