C++ examples for boost:file system
Getting the base path using Boost
#include <iostream> #include <cstdlib> #include <boost/filesystem/operations.hpp> using namespace std; using namespace boost::filesystem; int main(int argc, char** argv) { try { path p = complete(path("test", native)); cout << p.branch_path().string() << endl; } catch (exception& e) { cerr << e.what() << endl; } return(EXIT_SUCCESS); }