32 #include <BESInternalError.h> 34 #include "BESHandlerUtil.h" 52 TemporaryFile::TemporaryFile(
const std::string &path_template)
56 d_name.reserve(path_template.length() + 1);
58 string::size_type len = path_template.copy(&d_name[0], path_template.length());
63 mode_t original_mode = umask(077);
64 d_fd = mkstemp(&d_name[0]);
67 if (d_fd == -1)
throw BESInternalError(
"Failed to open the temporary file.", __FILE__, __LINE__);
exception thrown if inernal error encountered