13 #ifndef __STOUT_OS_POSIX_MKTEMP_HPP__ 14 #define __STOUT_OS_POSIX_MKTEMP_HPP__ 39 char* _path =
new char[
path.size() + 1];
40 ::memcpy(_path,
path.c_str(),
path.size() + 1);
42 int_fd fd = ::mkstemp(_path);
43 std::string
temp(_path);
63 #endif // __STOUT_OS_POSIX_MKTEMP_HPP__
Definition: errorbase.hpp:36
Try< std::string > mktemp(const std::string &path=path::join(os::temp(),"XXXXXX"))
Definition: mktemp.hpp:36
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
Try< Nothing > close(int fd)
Definition: close.hpp:24
static Try error(const E &e)
Definition: try.hpp:43
bool isError() const
Definition: try.hpp:78
std::string temp()
Definition: temp.hpp:27
int int_fd
Definition: int_fd.hpp:35
std::string stringify(int flags)