very silent? why not inform me - as USER - about such problematic cases in MY list?
Or I misunderstand current explanations and behavior?
I don't see "not found" or "wrong instance"...
Moderators: Hacker, petermad, Stefan2, white
very silent? why not inform me - as USER - about such problematic cases in MY list?
It says wildcards can be used in the last part (after last backslash), so not in the paths.ghisler(Author) wrote: 2022-08-28, 15:19 UTC Well, Total Commander just passes the paths to FindFirstFile, and the help for that Windows function doesn't mention wildcards in the path part:
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirstfilea
TC reports an error if Windows returns an error searching for a path, which doesn't seem to happen here. It just returns an empty result.very silent? why not inform me - as USER - about such problematic cases in MY list?
Sooooo, now, after these conversations you know that Windows Docs|API is not very useful and logical sometimes happenIt just returns an empty result.
Indeed, work around the Windows peculiarities and bugs. Especially that \\?\c:\thisfiledoesnotexist.txt doesn't generate a file not found error is a Windows bug in my opinion. Because support for \\?\ is mentioned in the API docs.AntonDudarenko wrote: 2022-08-29, 07:48 UTC For example in this current case we must validate users' input BEFORE sending it to FindFirstFile.
And for all forbidden instances (like wildcards chars in 'path' segment) report to USER, that this, this and this lines are wrong - and will not be used.
Confirmed fixed.ghisler(Author) wrote: 2022-08-29, 10:27 UTC Wildcards in the path should now cause an error. I have just released RC4, please test it!
Indeed, confirmed not fixed
Code: Select all
t<est
Code: Select all
|test
t<est
Code: Select all
|test
t<est
3
4
5
6
7
8
9
That's what I meant with:ghisler(Author) wrote: 2022-08-30, 07:23 UTC The reason why the search for \\?\c:\thisfiledoesnotexist.txt doesn't generate a file not found error is that the ? in the path makes the function wrongly assume that it has wildcards.
A solution for \\?\c:\thisfiledoesnotexist.txt could be, if FindFirstFile doesn't find any files, check if passed filename started with \\?\ and doesn't contain any other wildcard characters. If this is the case, show a file not found error.white wrote: 2022-08-26, 15:18 UTC Entries with wildcard characters in the path never throw a not found error.
c:\test*123\test1.txt
\\?\c:\test1.txt:Zone.Identifier
In my opinion, no error when there are zero results when using wildcards. If in the future people want an error in this case, they can make a suggestion. Perhaps then a command modifier can be made, or another solution.ghisler(Author) wrote: 2022-08-30, 07:23 UTC What do you think? Should it show an error when *.txt return zero results? Or would this annoy people who look for multiple file types like
*.docx
*.xlsx
*.txt
and be content if just one of them returned a result?
No, I will just skip the \\?\ at the beginning of the path when looking for wildcards.A solution for \\?\c:\thisfiledoesnotexist.txt could be, if FindFirstFile doesn't find any files, check if passed filename started with \\?\ and doesn't contain any other wildcard characters.
OK, then I will keep it as it is for lines with actual wildcards.In my opinion, no error when there are zero results when using wildcards.
Code: Select all
c:\test\trailing space
c:\test\trailing space \
Code: Select all
\\?\c:\test\trailing space
\\?\c:\test\trailing space \
Code: Select all
trspacefile
trspacefile \
Code: Select all
"test1.txt" (error is OK: "test1.txt")
"c:\test\test1.txt" (error is: test1.txt")
"\\?\c:\test\test1.txt" (error is: c:\test\"\\?\c:\test\test1.txt")
Code: Select all
\\?\c:\test\test1.txt (error is: c:\test\ \\?\c:\test\test1.txt")
Tested OK using TC10.51.HISTORY.TXT wrote: 31.08.22 Fixed: LOADLIST didn't show error for non existing files with paths with prefix \\?\, e.g. \\?\c:\nofilehere.txt (32/64)
31.08.22 Fixed: LOADLIST didn't work when called again in a list previously loaded with LOADLIST when not using folder tabs (32/64)
30.08.22 Fixed: LOADLIST didn't correctly handle paths with prefix \\?\, treated them as wildcards (32/64)