title: c++ 17 filesystem::recursive_directory_iterator() gives error no such directory on mac but works on windows
body: <p><strong>Configurations</strong></p>
  <ul>
  <li>macOS: 10.15.5</li>
  <li>xcode: 11.5</li>
  <li>clang: 11.0.3</li>
  <li>Project is set to c++17</li>
  </ul>
  <p>I am new to macOS and trying to solve a simple problem..</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;filesystem&gt;
  
  using namespace std;
  namespace fs = std::filesystem;
  
  int main(int argc, const char * argv[]) {
      for(const auto&amp; p: fs::recursive_directory_iterator(&quot;data/&quot;))
          cout &lt;&lt; p.path() &lt;&lt; '\n';
      return 0;
  }
  </code></pre>
  <p>This code gives me error (tried on xcode, clion and cmake) -</p>
  <pre><code>uncaught exception of type std::__1::__fs::filesystem::filesystem_error: 
  filesystem error: in recursive_directory_iterator: No such file or directory [data/]
  </code></pre>
  <p><strong>ISSUE</strong><br />
  Here data folder is created by me manually or some time automatically. Random files will be generated in it (sub directories files too), I need path and name of all those files.</p>
  <p><strong>ADDITIONAL INFORMATION</strong><br />
  <strong>This code works perfectly fine</strong></p>
  <pre><code>#include &lt;fstream&gt;
  #include &lt;iostream&gt;
  #include &lt;filesystem&gt;
  namespace fs = std::filesystem;
   
  int main()
  {
      fs::create_directories(&quot;sandbox/a/b&quot;);
      std::ofstream(&quot;sandbox/file1.txt&quot;);
      fs::create_symlink(&quot;a&quot;, &quot;sandbox/syma&quot;);
      for(auto&amp; p: fs::recursive_directory_iterator(&quot;sandbox&quot;))
          std::cout &lt;&lt; p.path() &lt;&lt; '\n';
      fs::remove_all(&quot;sandbox&quot;);
  }
  </code></pre>