title: PHP DirectoryIterator and .DS_Store File
body: <p>I have a local XAMP install on my Mac. I have this code:</p>
  
  <pre><code>foreach (new DirectoryIterator('test') as $fileInfo) {
      if ($fileInfo-&gt;isDot() &amp;&amp; $fileInfo-&gt;getBasename() !== '.DS_Store') {
          continue;
      }
  
      $xmlFile = "test/" . $fileInfo-&gt;getFilename() . "/content.xml";
  
      if (file_exists($xmlFile)) {
          $xml = simplexml_load_file($xmlFile);
          foreach ($xml-&gt;infos as $infos) {
              echo "&lt;li&gt;&lt;a href='#tab_3' data-toggle='tab'&gt;$infos-&gt;bezeichnung&lt;/a&gt;&lt;/li&gt;";
          }
      }
  }
  </code></pre>
  
  <p>The problem is that I get an error that says that the file <code>.DS_Store</code> cannot be opened. I thought my code filtered out the <code>.DS_Store</code> directory. It's clear that this file cannot be opened. It is a mac specific folder.</p>