[Lazarus] GetAllFilesMask / AllFilesMask

Jürgen Hestermann juergen.hestermann at gmx.de
Sun Apr 28 19:13:49 CEST 2013


Am 2013-04-28 18:33, schrieb Reinier Olislagers:
> On 28-4-2013 18:04, waldo kitty wrote:
>> On 4/28/2013 08:23, Bart wrote:
>>> But you must consider the end user.
>>> If on Windows someone types *.* in my program, he expects to find all
>>> files,
>> and yet those average joe windows users do not and are very unaware that
>> they are not finding all files...
> So what *would* the average Joe type and how is that handled right now?

I think there are different cases to look at:

1.) The Free Pascal constant AllFilesMask:
This should be "*" on Linux and "*.*" on Windows (and maybe even different on other OS'es). A programmer who uses this constant should rely on finding all files (the mask should match all files).

2.) A filter mask that is typed in by a user of a program:
This masked should be passed through to the OS API functions without change. The user should know what files match the mask for the OS he is currently using.

3.) A filter mask syntax defined by the programmer:
Sometimes it may be desireable to unify filter masks in a program that exists under different platforms. If the average user does not know about mask standards for each OS the programmer may define his own mask syntax which works the same on all OS'es. For example, there is a permanent disput (and different behaviour) about the question mark and whether it should match exactly one character (which I find logical) or one or less (which is implemented in many but not all OS shell tools).

So in 1.) the programmer decides what the user will find, in 2.) the user itself decides and in 3.) it's a mix.





More information about the Lazarus mailing list