You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Conception/drake-master/common/proto/rpc_pipe_temp_directory.cc

22 lines
494 B

#include "drake/common/proto/rpc_pipe_temp_directory.h"
#include <cstdlib>
#include <filesystem>
#include "drake/common/drake_throw.h"
namespace drake {
namespace common {
std::string GetRpcPipeTempDirectory() {
const char* path_str = nullptr;
(path_str = std::getenv("TEST_TMPDIR")) || (path_str = "/tmp");
const std::filesystem::path path(path_str);
DRAKE_THROW_UNLESS(std::filesystem::is_directory(path));
return path.string();
}
} // namespace common
} // namespace drake