title: How C++ boost::filesystem detect if path is file or directory?
body: <p>In boost::filesystem library is there any way to determine if the path is directory or file? </p>
  
  <p>My scenario is : I have some folders and files which i need full path of the all files and push it to vector, so i did this :</p>
  
  <pre><code>for ( boost::filesystem::recursive_directory_iterator end, dir(pathBase);
      dir != end; ++dir ) {
      if ( boost::filesystem::exists( dir-&gt;path() ) )
      {
          std::cout &lt;&lt; dir-&gt;path() &lt;&lt; "\n";  // full path
          filenames.push_back(dir-&gt;path().string());
      }
    }
  </code></pre>
  
  <p>The problem is the <code>exists</code> method check if directory or file exist and could not detect their type(file or directory).</p>
  
  <p>So how can i get only files with boost library?</p>