Sign in Join

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

Mailing lists / fpc-devel / 2008-03

suggestion: AllFilesMask constant

9 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

Could FPC add a new 'all files' constant (eg: AllFilesMask) to the RTL. Same as what we have PathDelimiter etc..

Lazarus LCL, fpGUI, tiOPF and I'm pretty sure MSEgui has it's own definition of this. That's just four projects I know about. That constant should really be part of the RTL as it's a very common constant to use.

const
  {$IFDEF WINDOWS}
  AllFilesMask := '*.*';
  {$ELSE}
  AllFilesMask := '*';
  {$ENDIF}

---------- Forwarded message ----------

Earlier message 38 lines
From: Graeme Geldenhuys Date: 25 Mar 2008 10:22 Subject: Re: [Lazarus] FindFile in sub directories using filter '*.cfg' To: General mailing list On 25/03/2008, Mattias Gaertner wrote: > > 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. > > > AllFilesMask > > Mattias Exactly my point. Lazarus has that defined, fpGUI has that defined and I'm pretty sure MSEgui has it defined as well. That constant should really be defined in Free Pascal's RTL, so everybody can use it! Regards, - Graeme - ------------------------[ end ]------------------ Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Hi, Could FPC add a new 'all files' constant (eg: AllFilesMask) to the RTL. Same as what we have PathDelimiter etc..

Please do a find declaration. AllFilesMask is in the system unit.

Mattias

Show quoted text 57 lines
Lazarus LCL, fpGUI, tiOPF and I'm pretty sure MSEgui has it's own definition of this. That's just four projects I know about. That constant should really be part of the RTL as it's a very common constant to use. const {$IFDEF WINDOWS} AllFilesMask := '*.*'; {$ELSE} AllFilesMask := '*'; {$ENDIF} ---------- Forwarded message ---------- From: Graeme Geldenhuys Date: 25 Mar 2008 10:22 Subject: Re: [Lazarus] FindFile in sub directories using filter '*.cfg' To: General mailing list On 25/03/2008, Mattias Gaertner wrote: > > 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. > > > AllFilesMask > > Mattias Exactly my point. Lazarus has that defined, fpGUI has that defined and I'm pretty sure MSEgui has it defined as well. That constant should really be defined in Free Pascal's RTL, so everybody can use it! Regards, - Graeme - ------------------------[ end ]------------------ Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote 10 lines
On Tue, 25 Mar 2008 10:30:28 +0200 "Graeme Geldenhuys" wrote: > Hi, > > Could FPC add a new 'all files' constant (eg: AllFilesMask) to the > RTL. Same as what we have PathDelimiter etc.. Please do a find declaration. AllFilesMask is in the system unit.

I just did, using Lazarus's 'Find in files' and found nothing in FPC 2.2.0 source directory. I'll do another search.

Lazarus also didn't code navigate (Ctrl+Click) after I typed AllFilesMask in my source code.

...searching....

Ah, it's not defined in FPC 2.2.0, but is in FPC 2.3.1. I better wrap my defines with a FPC version then. Thanks Mattias.

Regards,
- Graeme -

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

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys

Anybody know in AllFilesMask will be defined in FPC 2.2.2 as well, or only 2.3.x?

I need to know how to wrap my existing constant definitions for future FPC releases... For example, this is what I currently have, which means 2.0.4 and 2.2.0 needs to use the local defines and any later versions will use the one from RTL.

const
  // FPC 2.2.0 and earlier only
  {$if defined(VER2_0) or defined(VER2_2_0)}
    {$IFDEF UNIX}
    AllFilesMask    = '*';
    {$ELSE}
    AllFilesMask    = '*.*';
    {$ENDIF UNIX}
  {$endif}

Regards,
- Graeme -

Graeme Geldenhuys wrote 33 lines
On 25/03/2008, Mattias Gaertner wrote: > On Tue, 25 Mar 2008 10:30:28 +0200 > "Graeme Geldenhuys" wrote: > > > Hi, > > > > Could FPC add a new 'all files' constant (eg: AllFilesMask) to the > > RTL. Same as what we have PathDelimiter etc.. > > > Please do a find declaration. AllFilesMask is in the system unit. I just did, using Lazarus's 'Find in files' and found nothing in FPC 2.2.0 source directory. I'll do another search. Lazarus also didn't code navigate (Ctrl+Click) after I typed AllFilesMask in my source code. ...searching.... Ah, it's not defined in FPC 2.2.0, but is in FPC 2.3.1. I better wrap my defines with a FPC version then. Thanks Mattias. Regards, - Graeme -

Reply by email

Mattias Gärtner
to Graeme Geldenhuys: I just did, using Lazarus's 'Find in files' and found nothing in FPC 2.2.0 source…

Zitat von Graeme Geldenhuys :

Show quoted text 15 lines
On 25/03/2008, Mattias Gaertner wrote: > On Tue, 25 Mar 2008 10:30:28 +0200 > "Graeme Geldenhuys" wrote: > > > Hi, > > > > Could FPC add a new 'all files' constant (eg: AllFilesMask) to the > > RTL. Same as what we have PathDelimiter etc.. > > > Please do a find declaration. AllFilesMask is in the system unit. I just did, using Lazarus's 'Find in files' and found nothing in FPC 2.2.0 source directory. I'll do another search.

Yes, it was recently added, that's why all mentioned projects still have their own.

Show quoted text 9 lines
Lazarus also didn't code navigate (Ctrl+Click) after I typed AllFilesMask in my source code. ...searching.... Ah, it's not defined in FPC 2.2.0, but is in FPC 2.3.1. I better wrap my defines with a FPC version then.

It is in fpc 2.2.1 too.

Does '*' work under windows too?

Mattias

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 14 lines
On 25/03/2008, Mattias Gärtner wrote: > > > It is in fpc 2.2.1 too. Thanks. > > Does '*' work under windows too? On later version of Windows our code does (Win2000, WinXP and Vista are tested). I don't think it works on Win9x versions.

As far as I remember, * worked even in MS-DOS days ?

Michael.

Reply by email

Marco van de Voort
to Michael Van Canneyt
Show quoted text 6 lines
On Tue, 25 Mar 2008, Graeme Geldenhuys wrote: > > On later version of Windows our code does (Win2000, WinXP and Vista > are tested). I don't think it works on Win9x versions. As far as I remember, * worked even in MS-DOS days ?

Afaik it is an msdos-with-lfn (iow under w9x) extension. IOW it wouldn't work under plain dos.

Reply by email

Tomas Hajny
to Marco van de Voort
Marco van de Voort wrote 9 lines
> On Tue, 25 Mar 2008, Graeme Geldenhuys wrote: > > > > On later version of Windows our code does (Win2000, WinXP and Vista > > are tested). I don't think it works on Win9x versions. > > As far as I remember, * worked even in MS-DOS days ? Afaik it is an msdos-with-lfn (iow under w9x) extension. IOW it wouldn't work under plain dos.

To be more precise: '*' doesn't work without LFN support. This means that LFN enabled versions of DOS (including those where LFN support is only provided by some TSR) can use '*'.

On the other hand, all DOS and Windows (and OS/2) versions support '*.*' as an equivalent of "all files" (with or without extensions). This means that searching for '*.*' on Windows will find all of 'X.Y', 'a.' and '123', whereas the same search on Unix will only find 'X.Y' and 'a.'. From this point of view, you can safely use '*.*' on all DOS versions regardless of the status of LFN support. In theory, you could do the same on Windows too, but it's probably not guaranteed to stay like that in future versions.

Tomas

Reply by email