somewhere

This commit is contained in:
Dhanya Maliakal 2017-03-10 10:51:28 +01:00
parent 1e94ec0c6a
commit 300b014f73
4 changed files with 6 additions and 7 deletions

View File

@ -285,7 +285,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
/**
* Set File Path
* Checks for file directory existence before setting file path,
* If it doesn't exist, it will set it blank
* If it exists, it sets it
* @param c file path (max of 1000 characters)
*/
void setFilePath(const char c[]);

View File

@ -122,7 +122,8 @@ public:
GET_FILE_FORMAT=-1,/**< the receiver will return its file format */
BINARY, /**< binary format */
ASCII, /**< ascii format */
HDF5 /**< hdf5 format */
HDF5, /**< hdf5 format */
NUM_FILE_FORMATS
};

View File

@ -269,16 +269,14 @@ void UDPBaseImplementation::setFileName(const char c[]){
void UDPBaseImplementation::setFilePath(const char c[]){
FILE_LOG(logDEBUG) << __AT__ << " starting";
if(strlen(c)){
//check if filepath exists
struct stat st;
if(stat(c,&st) == 0)
strcpy(filePath,c);
else{
strcpy(filePath,"");
else
FILE_LOG(logWARNING) << "FilePath does not exist: " << filePath;
}
strcpy(filePath, c);
}
FILE_LOG(logDEBUG) << "Info: File path: " << filePath;
}

View File

@ -530,7 +530,7 @@ int slsReceiverTCPIPInterface::set_file_dir() {
else{
receiverBase->setFilePath(fPath);
retval = receiverBase->getFilePath();
if(retval == NULL){
if (retval == NULL || (strlen(fPath) && strcasecmp(fPath, retval))) {
ret = FAIL;
strcpy(mess,"receiver file path does not exist\n");
}