MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / create_temp_dir

Function create_temp_dir

performance-tests/bench/common/util.cpp:62–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62std::string create_temp_dir(const std::string& prefix)
63{
64 // Create the buffer for the path
65 ACE_TCHAR buffer[PATH_MAX] = ACE_TEXT("");
66 if (ACE::get_temp_dir(&buffer[0], PATH_MAX) == -1) {
67 return "";
68 }
69 ACE_OS::strcpy(
70 &buffer[0],
71 ACE_TEXT_CHAR_TO_TCHAR(join_path(
72 ACE_TEXT_ALWAYS_CHAR(&buffer[0]), prefix).c_str()));
73
74 // Append the process id and create the directory
75 const size_t len = ACE_OS::strlen(buffer);
76 ACE_OS::snprintf(buffer + len, PATH_MAX - len - 1,
77 ACE_TEXT("_%d"), ACE_OS::getpid());
78 if (ACE_OS::mkdir(buffer, S_IRWXU) == -1) {
79 return "";
80 }
81
82 return ACE_TEXT_ALWAYS_CHAR(buffer);
83}
84
85std::string iso8601(const std::chrono::system_clock::time_point& tp)
86{

Callers 1

ACE_TMAINFunction · 0.85

Calls 1

join_pathFunction · 0.85

Tested by

no test coverage detected