Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I know I've read about this somewhere before, but the best I could find right now was this reference to it in <a href="http://blogs.msdn.com/oldnewthing/archive/2007/12/17/6785519.aspx" rel="nofollow noreferrer">Raymond Chen's blog post</a>. The point is that Windows keeps a short (8.3) filename for every file with a long filename, for backward compatibility, and filename <strong>wildcards are matched against both the long and short filenames</strong>. You can see these short filenames by opening a command prompt and running "<code>dir /x</code>". Normally, getting a list of files which match <code>????????.tif</code> (8) returns a list of file with 8 or less characters in their filename and a .tif extension. But <strong>every file with a long filename also has a short filename with 8.3 characters, so they all match this filter</strong>.</p> <p>In your case both <code>GZ96A7005.tif</code> and <code>GZ96A7005001.tif</code> are long filenames, so they both have a 8.3 short filename which matches <code>????????.tif</code> (anything with 8 or more <code>?</code>'s).</p> <p>UPDATE... from <a href="http://msdn.microsoft.com/en-us/library/wz42302f.aspx" rel="nofollow noreferrer">MSDN</a>:</p> <blockquote> <p>Because this method checks against file names with both the 8.3 file name format and the long file name format, a search pattern similar to "<code>*1*.txt</code>" may return unexpected file names. For example, using a search pattern of "<code>*1*.txt</code>" returns "<code>longfilename.txt</code>" because the equivalent 8.3 file name format is "<code>LONGFI~1.TXT</code>".</p> </blockquote> <hr> <p>UPDATE: The MSDN docs specifiy different behavior for the "<code>?</code>" wildcard in Directory.GetFiles() and DirectoryInfo.GetFiles(). The documentation seems to be wrong, however. See <a href="https://stackoverflow.com/questions/963279/c-using-directory-getfiles-to-get-files-with-fixed-length/963289#963289">Matthew Flaschen's answer</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload