[fpc-pascal] findfirst wildcards...

waldo kitty wkitty42 at windstream.net
Wed Dec 3 23:18:38 CET 2014

On 12/3/2014 3:02 PM, Ralf Quint wrote:
> On 12/3/2014 8:30 AM, waldo kitty wrote:
>> yes, i wrote t11.txt when i should have written t1.txt... my bad...
>> however on
>>   OS/2 native
>>   OS/2 with 4OS2 command interpreter replacement
>>   OS/2 DOS native
>>   OS/2 DOS with 4DOS command interpreter replacement
>>   Vista (32bit)
>> t?.txt returns both t.txt and t1.txt...
> On any DOS based OS (that includes OS/2 and Windows), the "?" wildcard character
> will find any character, including no character at all in that position. So in
> your example, t?.txt will find t.txt and tx.txt but not txy.txt. It will not
> return any filename longer than your search mask, but return shorter filenames.
> This is (should be) a functionality of the underlying system calls.
> On *ix based systems, the filenames are evaluated by the shell, not the OS, and
> your search result will be different in a lot of cases...

yep... that's exactly been my findings... my main goal, in this case, is/was to 
find a way of having multiple masks... messing with MatchesMaskList showed me 
the difference which i was trying to figure out as it was not what was expected...

now i have three choices and don't yet know which i'll choose... most likely the 
plain findfirst with multiple masks one... it works and its operation is as 
expected from ~30 years messing with computers... the regex one will definitely 
stay in the stack as it offers an easy method to go both ways and that may be 
desirable in some cases... i just have to test it on OS/2 and see if i can 
compile it... i can't do that with MatchesMaskList because the unit that 
contains it is not available on OS/2...

  NOTE: No off-list assistance is given without prior approval.
        Please *keep mailing list traffic on the list* unless
        private contact is specifically requested and granted.

More information about the fpc-pascal mailing list