title: Boost Filesystem exists Access violation
body: <p>I have a Problem with <code>boost::filesystem::exists(pathName)</code>.</p>
  
  <p>When the folder did not exists the method returns <code>false</code> as expected.
  If the Folder exists it throws an exception in the <code>make_permissions(const path&amp; p, DWORD attr)</code> Method of the Boost File <code>operations.cpp</code>.</p>
  
  <p>This is the code from that file </p>
  
  <pre><code>if (equal_string_ordinal_ic(ext.c_str(), L".exe")
    || equal_string_ordinal_ic(ext.c_str(), L".com")
    || equal_string_ordinal_ic(ext.c_str(), L".bat")
    || equal_string_ordinal_ic(ext.c_str(), L".cmd"))
    prms |= fs::owner_exe | fs::group_exe | fs::others_exe;
  return prms;
  </code></pre>
  
  <p>The Message is:</p>
  
  <pre><code>Exception thrown at 0x00000000 in LineSync.exe: 0xC0000005: Access violation executing location 0x00000000.
  </code></pre>
  
  <p>This is thrown on the <code>if</code> Statement. 
  I use this Method inside a MFC Application under Windows 10. On Windows 7 the Problem did not exist.</p>
  
  <p>If I create a sample Windows Console Application on Windows 10, the Problem also did not happen.</p>
  
  <p>This is the Code which did not work on the <code>MFC</code> Project but did work on an Windows 10 Console Application.</p>
  
  <pre><code>boost::filesystem::path pathDir(L"logs");
  if (!boost::filesystem::exists(pathDir)) {
      boost::filesystem::create_directory(pathDir);
  }
  </code></pre>
  
  <p>Changing to <code>boost::filesystem::is_directory(pathDir)</code> did also result in the exception on the MFC Project</p>
  
  <p>Is there a Problem with MFC and Windows 10?
  Or is there a better way to check if a specific directory exists?</p>
  
  <p>EDIT 2:</p>
  
  <p>This is an example which should cause the error on Windows with Boost 1.66</p>
  
  <pre><code>bool dummy = boost::filesystem::exists("logs");
  
  class Demo {
  public:
      ~Demo() {
          std::cout &lt;&lt; boost::filesystem::path("logs").string() &lt;&lt; std::endl;
      }
  };
  
  Demo d;
  
  int main()
  {
      Demo();
      system("PAUSE");
      return 0;
  }
  </code></pre>