Getting the base path using Boost - C++ boost

C++ examples for boost:file system

Description

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);
}

Related Tutorials