[Lazarus] unit Masks vs. unit FPMasks

José Mejuto joshyfun at gmail.com
Thu Feb 25 09:27:36 CET 2021

El 24/02/2021 a las 22:36, Bart via lazarus escribió:

>> Filename:='test.txt'
>> Mask:='test??.txt?'
>> Match must be true
> That sucks big time.
> A ? is supposed to match EXACTLY 1 character (not optional).
> Bloody @#$%$#@#$ Micro$uck,


This quirk has its explanation which is 8.3 backwards compatibility. The 
old 8.3 masking (well the system itself) resolves masks setting the name 
and extension in a 11 bytes array where space is a "no-char", so file 
name "TEST.TXT" is stored as "TEXT    " and "TXT" and if you apply this 
mask "TEST????.TXT" its logical that it evaluates to a positive match.

I'm quite sure that this comes from CP/M times.

Have a nice day.


More information about the lazarus mailing list