[fpc-pascal] findfirst wildcards...

waldo kitty wkitty42 at windstream.net
Wed Dec 3 23:24:01 CET 2014


On 12/3/2014 3:27 PM, Bart wrote:
> On 12/3/14, Ralf Quint <freedos.la at gmail.com> wrote:
>
>> 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.
>
> Windows.FindFirstFile however treats ? as exactly 1 character AFAIK.
> And is I'm not mistake this was also the case with TP in the old days.

my command line testing shows otherwise... are you speaking of GUI related code? 
i'm working only with the command line... no GUI stuffs at all...


C:\freepascal\projects\misc>cmd
Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\freepascal\projects\misc>dir t*.txt
  Volume in drive C is SQ004512V04
  Volume Serial Number is DC02-9142

  Directory of C:\freepascal\projects\misc

12/02/2014  11:31 PM                 2 t.txt
12/02/2014  11:31 PM                 2 t1.txt
12/02/2014  11:31 PM                 2 t11.txt
                3 File(s)              6 bytes
                0 Dir(s)  50,785,431,552 bytes free

C:\freepascal\projects\misc>dir t?.txt
  Volume in drive C is SQ004512V04
  Volume Serial Number is DC02-9142

  Directory of C:\freepascal\projects\misc

12/02/2014  11:31 PM                 2 t.txt
12/02/2014  11:31 PM                 2 t1.txt
                2 File(s)              4 bytes
                0 Dir(s)  50,785,431,552 bytes free

C:\freepascal\projects\misc>command
Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.

C:\FREEPA~1\PROJECTS\MISC>dir t?.txt
  Volume in drive C is SQ004512V04
  Volume Serial Number is DC02-9142

  Directory of C:\FREEPA~1\projects\misc

12/02/2014  11:31 PM                 2 t.txt
12/02/2014  11:31 PM                 2 t1.txt
                2 File(s)              4 bytes
                0 Dir(s)  50,785,423,360 bytes free

C:\FREEPA~1\PROJECTS\MISC>

-- 
  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