When I try to call CFileFind.FindFile(_T("D://Folder//*.txt")), the method returns true when the only file is “foobar.txta”.
However, I don’t want the file foobar.txta to be included the find result. How do I make it that way? Probably by using other method or another if ? I’m a newbie in C++ :))
Note: This issue does not seem to happen if the exension is less than 3, for example if filter is “*.tx” and file is “foobar.txt” the method still (correctly) return false.
Also, the issue seems to be reported here but seems like I need to pay to see the solution
As the other answerers have noted, the apparent bug is because a Windows file have a 8.3 alias, causing “foobar.txta” to be detected as “foobar.txt”. To make sure that a file found by CFileFind indeed match the wildcard pattern, use ‘PathMatchSpec’ to validate the file returned by finder.GetNextFile().
PathMatchSpecseems not to be affected by the 8.3 alias.