10641.cpp 470 B

1234567891011121314151617181920
  1. #include <iostream>
  2. #include <boost/filesystem/path.hpp>
  3. using namespace std;
  4. namespace fs = boost::filesystem;
  5. int main(int argc, char** argv)
  6. {
  7. try
  8. {
  9. fs::path my_path("test/test.txt");
  10. cout << "current path is " << my_path << endl;
  11. cout << "parent path is " << my_path.parent_path() << endl;
  12. }
  13. catch(std::exception& e) {
  14. cerr << endl << "Error during execution: " << e.what() << endl << endl;
  15. return EXIT_FAILURE;
  16. }
  17. return EXIT_SUCCESS;
  18. }