Removing a file with Boost - C++ boost

C++ examples for boost:file system

Description

Removing a file with Boost

#include <iostream>
#include <string>
#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("main.cpp", native));
      remove(p);
   }
   catch (exception& e) {
      cerr << e.what() << endl;
   }
   return(EXIT_SUCCESS);
}

Related Tutorials