13 #ifndef __STOUT_OS_POSIX_MKTEMP_HPP__
14 #define __STOUT_OS_POSIX_MKTEMP_HPP__
39 char*
temp =
new char[path.size() + 1];
40 ::memcpy(temp, path.c_str(), path.size() + 1);
42 int_fd fd = ::mkstemp(temp);
53 std::string result(temp);
61 #endif // __STOUT_OS_POSIX_MKTEMP_HPP__
Try< std::string > mktemp(const std::string &path=path::join(os::temp(),"XXXXXX"))
Definition: mktemp.hpp:36
Definition: errorbase.hpp:49
std::string join(const std::string &path1, const std::string &path2, const char _separator=os::PATH_SEPARATOR)
Definition: path.hpp:56
Try< Nothing > close(int fd)
Definition: close.hpp:24
std::string temp()
Definition: temp.hpp:27
int int_fd
Definition: int_fd.hpp:35