[Lazarus] FindFile in sub directories using filter '*.cfg'

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Mar 25 08:02:38 CET 2008


On 25/03/2008, el stamatakos <el_stamatakos at hotmail.com> wrote:
>
>  Hi,
>   I have a function that has worked quite well in Windows. Now I try to use
> it on Linux and it does not appear to be going into subdirectories where the
>  constructor TFindFile.Create(AOwner: TComponent);
> begin
>   inherited Create(AOwner);
>   Path := IncludeTrailingBackslash(GetCurrentDir);
>   FileMask := '*.*';


The filemask is you problem.  Under Linux or any *unix environment,
the filemask must be '*' only. If you use '*.*', your directory name
must have a '.' somewhere in the name, to be found. '*' covers all
names.

I think you can even use the '*' under Windows too, without having to
resort to IFDEF's.

I really think FPC should have a AllFiles file mask in the RTL, like
it has for Path Delimiters etc...  I've created numerous projects
where I used IFDEF's to define a cAllFiles constant for specific
platforms.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the Lazarus mailing list