A customer asked for clarification in the documentation for FindFirstFile
and related functions, such as FindFirstFileEx
and FindFirstFileTransacted
Does
FindFirstFileEx
support multiple wildcards in the lpFileName parameter? The documentation is not clear. We are hoping to pass something likeC:\Directory1\Directory2\*abc*\def*.txt
. Note that there are two asterisks in the directory portion as well as an asterisk in the file name portion. Should we expect this to work? The documentation is not very explicit about this scenario. It just sayslpFileName: The directory or path, and the file name, which can include wildcard characters, for example, an asterisk (*) or a question mark (?).
I agree that the documentation is ambiguous here. One interpretation of the sentence is
The directory or path, and the file name, any of which can include wildcard characters, for example, an asterisk (*) or a question mark (?).
Or it could be interpreted as
The directory or path, and the file name. The file name can include wildcard characters, for example, an asterisk (*) or a question mark (?).
You can have multiple wildcards, but all wildcards must exist in the file name portion. The search pattern lets you apply a filter to a search within a single directory. It is not a SQL query.
I submitted a documentation change request to clarify the sentence to the second version above:
The directory or path, and the file name. The file name can include wildcard characters, for example, an asterisk (*) or a question mark (?).
0 comments