5 #include "boost/filesystem.hpp" 6 #include "boost/system/error_code.hpp" 20 boost::filesystem::path
const p(stem +
"-%%%%-%%%%-%%%%-%%%%" + extension);
21 boost::filesystem::path outpath;
22 boost::system::error_code ec;
23 int tmp_fd = -1,
error = 0;
25 outpath = boost::filesystem::unique_path(p, ec);
26 }
while (!ec && (tmp_fd = creat(outpath.c_str(), S_IRUSR | S_IWUSR)) == -1 &&
27 (
error = errno) == EEXIST);
32 e <<
"RootOutput cannot ascertain a unique temporary filename for output " 43 return outpath.native();
std::string unique_filename(std::string stem, std::string extension=".root")
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception