37 #include <sys/types.h> 70 std::size_t exec_file_pos =
dbexec_.find_last_of(
"/\\");
71 if (exec_file_pos != std::string::npos)
73 char** argv =
new char*[4];
74 std::size_t exec_length = 1 +
dbexec_.length() - exec_file_pos;
75 argv[0] =
new char[1 + exec_length];
76 snprintf(argv[0], exec_length,
"%s",
dbexec_.substr(exec_file_pos + 1).c_str());
78 argv[1] =
new char[16];
79 snprintf(argv[1], 15,
"--dbpath");
81 argv[2] =
new char[1024];
82 snprintf(argv[2], 1023,
"%s", dirname.c_str());
86 int code = execv(
dbexec_.c_str(), argv);
91 ROS_ERROR_STREAM(
"execv() returned " << code <<
", errno=" << errno <<
" string errno = " << strerror(errno));
bool connectToDatabase(const std::string &db_dirname)
#define ROS_ERROR_STREAM(args)
WarehouseConnector(const std::string &dbexec)