title: How can I ignore a determinated file in recursive search?
body: <p>I was working on a project to list all files and directories and their recursive elements from a path, code of the function:</p>
  <pre><code>    def recursive_search(path: str) -&gt; &quot;list[str]&quot;:
      &quot;&quot;&quot;get all files from an absolute path
  
     :param path: absolute path of the directory to search
     :type path: str
     :return: a list of all files
     :rtype: list[str]
     &quot;&quot;&quot;
      found_files = []
      if not os.path.isdir(path):
          raise RuntimeError(f&quot;'{path}' is not a directory&quot;)
      for item in os.listdir(path):
          full_path = os.path.join(path, item)
          if os.path.isfile(full_path):
              found_files.append(full_path)
          elif os.path.isdir(full_path):
              found_files.extend(recursive_search(full_path))
      return found_files
  </code></pre>
  <p>I call the function like this:</p>
  <pre><code>if __name__ == '__main__':
      user = getuser()
      directory = &quot;C:\\Users\\&quot; + user + &quot;\\Desktop\\archivos&quot;
      path = (recursive_search(directory))
  </code></pre>
  <p>Its possible ignore a file, for example I want to get all directories and files from &quot;C:\Users\XXX\Desktop&quot;, but I  don't want to catch the file &quot;C:\Users\XXX\Desktop\desktop.ini&quot;, how I can do this?</p>
  <p>Thanks.</p>