From: Jonathan de Boyne Pollard on
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<blockquote cite="mid:8ffnk5p0r1gvd6mkvl4rvj9n6qrbtncoqt(a)4ax.com"
type="cite">
<p wrap="">The first time with a pattern match of <code>*.*</code>
[...]<br>
</p>
</blockquote>
<p>Stop that.&nbsp; You're not writing a DOS program.&nbsp; This is Win32.&nbsp; Use <code>*</code>
to match all files.</p>
</body>
</html>
From: Jonathan de Boyne Pollard on
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<blockquote
cite="mid:cfafb951-6dfd-40d9-bb4b-43ef096dcd71(a)z41g2000yqz.googlegroups.com"
type="cite">
<p wrap="">I'm not aware of any, and technically speaking, that
wouldn't be enough information for the API to function 100% properly,
for instance, sometimes <code>APICall("thisisatest.txt", "*1*")</code>
should return true to match how <code>FindFirstFile</code> operates:<br>
</p>
</blockquote>
<p>That functionality, dubiously useful as it may be, can be achieved
outside of the wildcard matching function itself, by saving both long
and short names from the first directory scan, and calling the wildcard
matching function against both names.&nbsp; However, I strongly suspect that
exactly emulating all of the longname/shortname quirks of <code>FindFirstFile()</code>
isn't actually the desired behaviour in the first place, here, and "How
do I stop <code>FindFirstFile()</code> from matching shortnames?"
would have been the next question had this design choice proven to be
unworkable.<br>
</p>
<p>The POSIX API function for doing this task is <code>fnmatch()</code>,
by
the
way.&nbsp; If it isn't in Microsoft's POSIX subsystem (I haven't
looked.),
there's undoubtedly a port <em>somewhere</em>.<br>
</p>
<p>For what it's worth, I went down this same single-pass design route
with my utilities.&nbsp; Three things militated against it.&nbsp; The first two
don't apply to Win32.&nbsp; But the third was that it can actually be a
significant benefit to tell the filesystem driver as much as possible
about what directory entries one wants to filter out, especially if
remote volumes are involved.<br>
</p>
</body>
</html>