mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
receiver create path (#35)
This commit is contained in:

committed by
Dhanya Thattil

parent
136e00d15e
commit
d3101baacb
@ -13,6 +13,7 @@
|
||||
#include "GeneralData.h"
|
||||
#include "Listener.h"
|
||||
#include "ZmqSocket.h" //just for the zmq port define
|
||||
#include "file_utils.h"
|
||||
|
||||
#include <cerrno> //eperm
|
||||
#include <cstdlib> //system
|
||||
@ -555,12 +556,8 @@ void slsReceiverImplementation::setFilePath(const char c[]) {
|
||||
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
||||
|
||||
if (strlen(c)) {
|
||||
// check if filepath exists
|
||||
struct stat st;
|
||||
if (stat(c, &st) == 0)
|
||||
strcpy(filePath, c);
|
||||
else
|
||||
FILE_LOG(logERROR) << "FilePath does not exist: " << c;
|
||||
mkdir_p(c); //throws if it can't create
|
||||
strcpy(filePath, c);
|
||||
}
|
||||
FILE_LOG(logINFO) << "File path: " << filePath;
|
||||
}
|
||||
|
@ -808,6 +808,8 @@ int slsReceiverTCPIPInterface::set_file_dir(Interface &socket) {
|
||||
|
||||
if (strlen(fPath) != 0) {
|
||||
FILE_LOG(logDEBUG1) << "Setting file path: " << fPath;
|
||||
if(fPath[0] != '/')
|
||||
throw RuntimeError("Receiver path needs to be absolute path");
|
||||
impl()->setFilePath(fPath);
|
||||
}
|
||||
std::string s = impl()->getFilePath();
|
||||
|
Reference in New Issue
Block a user