title: How to check if multiple file exists in a directory
body: <p>I wanted to check if multiple file with same extension exists in a directory, if found perform the operation. Since file exists only accepts one argument as a filename, its not seems to be working for me.</p>
  
  <p>I tried the following code.</p>
  
  <pre><code>set filenames [glob *.cpf]
  
        if {[file exists $filenames == 1 }  {
        file delete {*} [glob *.cpf]
  } 
  </code></pre>
  
  <p>This code didn't deletes the files eg: a.cp, b.cpf in a directory and seems to skipping this step.
  Please suggest if i am missing something.</p>
  
  <p>Dan</p>