title: C++: Boost: how do I check the existence of a folder inside another folder in my working directory?
body: <p>code:</p>
  
  <pre><code>boost::filesystem::path config_folder(Config::CONFIG_FOLDER_NAME);
  
  if( !(boost::filesystem::exists(config_folder)))
  {
      std::cout &lt;&lt; "Network Config Directory not found...\n";
      std::cout &lt;&lt; "Creating folder called " &lt;&lt; Config::CONFIG_FOLDER_NAME &lt;&lt; "\n";
      boost::filesystem::create_directory(config_folder);
  }
  
  if( !(boost::filesystem::exists(boost::format("%s/%s") % config_folder % Config::fmap[Config::current_hash_function]));
  {
      std::cout &lt;&lt; "This hash has not been configure before...\n";
      std::cout &lt;&lt; "Creating folder called " &lt;&lt; Config::fmap[Config::current_hash_function] &lt;&lt; "\n";
      boost::filesystem::create_directory(boost::format("%s/%s") % config_folder % Config::fmap[Config::current_hash_function]);
  }
  </code></pre>
  
  <p>So, first, if the config folder doesn't exist, create that. (this part works)
  Next, check if the current_hash_function folder exists, if not.. create it. (this part doesn't work)</p>
  
  <p>The error I'm getting;</p>
  
  <pre><code>src/neural_networks/shared.cpp:41: error: no matching function for call to ‘exists(boost::basic_format&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;)’
  </code></pre>
  
  <p>reason why I did the boost format in the fs:exists check, is because I don't how to create a path 2 levels deep</p>