directory.getfiles problem

vbert

New member
Joined
Nov 22, 2006
Messages
1
Programming Experience
Beginner
directory.getfiles(path,pattern) where the pattern is a 2-digit string may produce filename(s) which does not contain the pattern. An example is:path C:\Windows\Help\Tours\htmltour\ and pattern *99*which gives the following filename : start_icons.htm
In reply to cjard: it is not restricted to 99. You can find many examples of other 2 or 3 digit strings e.g.:path C:\windows\media\ and pattern *87* which gives the filename: windows XP notify.wav
 
Last edited:
I agree

VB.NET:
?System.IO.Directory.GetFiles("c:\\temp", "*99*", System.IO.SearchOption.AllDirectories)
{Dimensions:[7]}
[0]: "c:\\temp\\vs2k5\\vs\\_17299_RTL_x86_enu_VSD_Skins_SMP_QVGA.cab"
[1]: "c:\\temp\\vs2k5\\vs\\_18990_RTL_x86_enu_WMI_MSI.cab"
[2]: "c:\\temp\\vs2k5\\vs\\_1996_RTL_x86_enu_VS_SQL_Debug.cab"
[3]: "c:\\temp\\vs2k5\\vs\\_3995_RTL_x86_enu_Dotfuscator.cab"
[4]: "c:\\temp\\vs2k5\\msdn\\_17499_RTL_x86_enu_VSTO_HxS.cab"
[COLOR=red][5]: "c:\\temp\\vs2k5\\msdn\\Program Files\\MSDN\\MSDN8.0\\kb10\\1033\\enu_kbppt10kb.hxs"[/COLOR]
[COLOR=red][6]: "c:\\temp\\vs2k5\\msdn\\Program Files\\MSDN\\MSDN8.0\\kb10\\1033\\enu_kbsqlserver.hxs"[/COLOR]

It seems peculier to 99. I investigated whenther the 99 could be a wildcard match for "any 2 digit number" i.e. matching the 10 in 'kb10' but searching for *kb99* brought nothing. I ran a multitude of other tests but still am at a loss to explain the red results.

Perhaps one of the guys here who has some ability to view the sourcecode of getfiles() can answer?
 
Last edited:
Back
Top