{"id":92141,"date":"2015-11-25T07:00:00","date_gmt":"2015-11-25T22:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/20151125-00\/?p=92141\/"},"modified":"2019-03-13T12:22:09","modified_gmt":"2019-03-13T19:22:09","slug":"20151125-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20151125-00\/?p=92141","title":{"rendered":"Clarifying the documentation on wildcards accepted by FindFirstFile\/FindFirstFileEx"},"content":{"rendered":"<p>A customer asked for clarification in the documentation for <code>Find&shy;First&shy;File<\/code> and related functions, such as <code>Find&shy;First&shy;File&shy;Ex<\/code> and <code>Find&shy;First&shy;File&shy;Transacted<\/code> <\/p>\n<blockquote CLASS=\"q\">\n<p>Does <code>Find&shy;First&shy;File&shy;Ex<\/code> support multiple wildcards in the <i>lpFile&shy;Name<\/i> parameter? The documentation is not clear. We are hoping to pass something like <code>C:\\Directory1\\Directory2\\*abc*\\def*.txt<\/code>. 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 says <\/p>\n<p><i>lpFileName<\/i>: The directory or path, and the file name, which can include wildcard characters, for example, an asterisk (*) or a question mark (?). <\/p>\n<\/blockquote>\n<p>I agree that the documentation is ambiguous here. One interpretation of the sentence is <\/p>\n<blockquote CLASS=\"m\"><p>The directory or path, and the file name, any of which can include wildcard characters, for example, an asterisk (*) or a question mark (?). <\/p><\/blockquote>\n<p>Or it could be interpreted as <\/p>\n<blockquote CLASs=\"m\"><p>The directory or path, and the file name. The file name can include wildcard characters, for example, an asterisk (*) or a question mark (?). <\/p><\/blockquote>\n<p>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. <a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2005\/07\/21\/441330.aspx\">It is not a SQL query<\/a>. <\/p>\n<p>I submitted a documentation change request to clarify the sentence to the second version above: <\/p>\n<blockquote CLASs=\"m\"><p>The directory or path, and the file name. The file name can include wildcard characters, for example, an asterisk (*) or a question mark (?). <\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Only in the file name portion.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-92141","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Only in the file name portion.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/92141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=92141"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/92141\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=92141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=92141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=92141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}