SolidWallOfCode commented on a change in pull request #8718:
URL: https://github.com/apache/trafficserver/pull/8718#discussion_r826576337
##########
File path: iocore/cache/test/main.cc
##########
@@ -24,9 +24,23 @@
#define CATCH_CONFIG_MAIN
#include "main.h"
+#include <unistd.h>
+#include <filesystem>
+
#define THREADS 1
#define DIAGS_LOG_FILE "diags.log"
+// Create a new temp directory and return it
+std::string
+temp_prefix()
+{
+ char buffer[PATH_MAX];
+ snprintf(buffer, sizeof(buffer), "%s/cachetest.XXXXXX", getenv("TMPDIR") ?:
"/tmp");
+ auto prefix = std::filesystem::path(mkdtemp(buffer));
Review comment:
Actually, I think what would be better is to put this in `ts::file` and
have it return a `ts::file::path`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]