13 #ifndef FILES_READ_AND_WRITE_PATHSANDFILES_HPP
14 #define FILES_READ_AND_WRITE_PATHSANDFILES_HPP
18 #include <boost/filesystem.hpp>
19 #include "VCluster/VCluster.hpp"
28 cwd = getcwd(cwd, size);
47 boost::filesystem::path pathObj(path);
48 if (boost::filesystem::exists(pathObj) && boost::filesystem::is_regular_file(pathObj))
55 catch (boost::filesystem::filesystem_error & e)
57 std::cerr << e.what() << std::endl;
68 auto & v_cl = create_vcluster();
73 std::ofstream outfile (path);
90 boost::filesystem::path pathObj(path);
91 if (boost::filesystem::exists(pathObj) && boost::filesystem::is_directory(pathObj))
return true;
93 catch (boost::filesystem::filesystem_error & e)
95 std::cerr << e.what() << std::endl;
105 auto & v_cl = create_vcluster();
106 if (v_cl.rank() == 0)
110 boost::filesystem::create_directory(path);
115 std::cout <<
"Folder for current settings ( '" << path <<
"' ) already exists. New files will be saved to this folder." << std::endl;
126 #endif //FILES_READ_AND_WRITE_PATHSANDFILES_HPP