persistent/util.hpp
// verify the existence of a folder
// Check if directory exists or not. Create it on absence.
// return error if creating failed
verify the existence of a folder
Check if directory exists or not. Create it on absence.
return error if creating failed
verify the existence of a folder Check if directory exists or not . Create it on absence . return error if creating failed
inline void checkOrCreateDir(const std::string & dirPath)
noexcept(false) {
  struct stat sb;
  if (stat(dirPath.c_str(),&sb) == 0) {
    if (! S_ISDIR(sb.st_mode)) {
      throw PERSIST_EXP_INV_PATH;
    }
  } else {
    if (mkdir(dirPath.c_str(),0700) != 0) {
      throw PERSIST_EXP_CREATE_PATH(errno);
    }
  }
}
inline void checkOrCreateDir ( const std :: string & dirPath ) noexcept ( false ) { struct stat sb ; if ( stat ( dirPath . c_str ( ) , & sb ) == 0 ) { if ( ! S_ISDIR ( sb . st_mode ) ) { throw PERSIST_EXP_INV_PATH ; } } else { if ( mkdir ( dirPath . c_str ( ) , 0700 ) != 0 ) { throw PERSIST_EXP_CREATE_PATH ( errno ) ; } } }
verify the existence of a folder
Check if directory exists or not.
verify the existence of a folder Check if directory exists or not .
// create it