Creating a directory with Boost - C++ boost

C++ examples for boost:file system

Description

Creating a directory with Boost

#include <iostream>
#include <string>
#include <cstdlib>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/fstream.hpp>

using namespace std;
using namespace boost::filesystem;

int main(int argc, char** argv) {
   try {
      path p = complete(path("newFolder2", native));
      create_directory(p);
   }
   catch (exception& e) {
      cerr << e.what() << endl;
   }

  return(EXIT_SUCCESS);
}

Related Tutorials