Hello All,<br><br>I am trying to create a directory structure having 4 to 5 levels. When I try to call the boost::filesystem::create_directories(src); It throws an exception saying that path does not exist .So isn't create_directories() mean't for creating directory structure recursively or is there a other api which does it. I could not find Api's which can split the path ,and give the directory names in the path starting after the root directory up to leaf directory . <br><br>I am attaching the sample code .<br><br>#include <iostream><br>#include "boost/filesystem/operations.hpp"<br>#include "boost/filesystem/path.hpp"<br>#include "boost/filesystem/convenience.hpp" <br>int main()<br>{<br> const char* srcPath = "C:\\tmp\\dir1\\dir2\\dir3\\"; (this structure does not exist)<br> boost::filesystem::path src = boost::filesystem::path(srcPath, boost::filesystem::no_check); <br> <br> try<br> {<br> boost::filesystem::create_directories(relativepath); // throws exception <br> if(src.has_branch_path())<br> {<br> boost::filesystem::path branchpath = src.branch_path ();<br> std::cout << branchpath.string(); // prints C:<br> boost::filesystem::path rootpath = src.root_path();<br> std::cout << rootpath.string(); //prints C:<br> boost::filesystem::path relativepath = src.relative_path();<br> std::cout << relativepath.string(); //prints tmp\\dir1\\dir2\\dir3\\<br> <br> <br><br> }<br> <br> <br> }<br> catch(std::exception& ex) <br> {<br> std::cout << ex.what() << std::endl;<br> }<br><br>return 0;<br>}<br><br><br>Thanks in advance for the replies.<br><br>Rajesh <br>