GetFiles returns incorrect number of files when filename contains a bracket
<p>I need to copy files from one directory to another, however if the filename is already present in the target directory - I need to make it unique, all files need to be copied without overwriting.</p>

<p>I have the following code:</p>

<pre><code>String filenameBody = fi.Name.Substring(0, fi.Name.Length - fi.Extension.Length);
String fileDup = String.Format("{0}*{1}", filenameBody, fi.Extension);

FileInfo[] fiNotFound = diNotFound.GetFiles(fileDup);

if (fiNotFound.Length &gt; 0)
   newFilename = Path.Combine(diNotFound.ToString(), 
      String.Format("{0}_{1}{2}", filenameBody, fiNotFound.Length + 1,fi.Extension));
else 
    newFilename = Path.Combine(diNotFound.ToString(), fi.Name);

fi.MoveTo(newFilename);
Console.WriteLine(" Not Found");
</code></pre>

<p>The problem arises when the filename contains a bracket, e.g. (1).pdf GetFiles only returns one file back when I give it the pattern (1)*.pdf, but I happen to know there are at least two - so when the MoveTo is called it fails with file already exists - so how can I use GetFiles when the filename is in this pattern?</p>