17 #ifndef __STOUT_OS_POSIX_MKDTEMP_HPP__ 18 #define __STOUT_OS_POSIX_MKDTEMP_HPP__ 41 char*
temp =
new char[
path.size() + 1];
42 ::memcpy(temp,
path.c_str(),
path.size() + 1);
44 if (::
mkdtemp(temp) !=
nullptr) {
45 std::string result(temp);
57 #endif // __STOUT_OS_POSIX_MKDTEMP_HPP__
Definition: errorbase.hpp:50
Definition: posix_signalhandler.hpp:23
std::string join(const std::string &path1, const std::string &path2, const char _separator=os::PATH_SEPARATOR)
Definition: path.hpp:116
std::string temp()
Definition: temp.hpp:27
Try< std::string > mkdtemp(const std::string &path=path::join(os::temp(),"XXXXXX"))
Definition: mkdtemp.hpp:38