irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_default_paths.cpp
Go to the documentation of this file.
1 #include <dlfcn.h>
2 #include <boost/filesystem.hpp>
3 #include "irods_exception.hpp"
4 
5 
6 namespace irods {
7  boost::filesystem::path
9  Dl_info dl_info;
10  const int dladdr_ret = dladdr(__FUNCTION__, &dl_info);
11  if (dladdr_ret == 0) {
12  THROW(-1, "dladdr returned 0");
13  }
14 
15  if (dl_info.dli_fname == nullptr) {
16  THROW(-1, "dli_fname is null");
17  }
18  try {
19  boost::filesystem::path path{dl_info.dli_fname};
20  path = boost::filesystem::canonical(path);
21  path.remove_filename().remove_filename().remove_filename(); // Removes filename and the two directories (usr and lib) between libirods_common.so and base of irods install
22  return path;
23  } catch(const boost::filesystem::filesystem_error& e) {
24  THROW(-1, e.what());
25  }
26  }
27 
28  boost::filesystem::path
30  boost::filesystem::path path{get_irods_root_directory()};
31  path.append("etc").append("irods");
32  return path;
33  }
34 
35  boost::filesystem::path
37  boost::filesystem::path path{get_irods_root_directory()};
38  path.append("var").append("lib").append("irods");
39  return path;
40  }
41 
42  boost::filesystem::path
44  boost::filesystem::path path{get_irods_root_directory()};
45  path.append("usr").append("lib").append("irods").append("plugins");
46  return path;
47  }
48 }
THROW
#define THROW(_code, _msg)
Definition: irods_exception.hpp:68
irods::get_irods_home_directory
boost::filesystem::path get_irods_home_directory()
Definition: irods_default_paths.cpp:36
irods::get_irods_config_directory
boost::filesystem::path get_irods_config_directory()
Definition: irods_default_paths.cpp:29
irods_exception.hpp
irods::get_irods_root_directory
boost::filesystem::path get_irods_root_directory()
Definition: irods_default_paths.cpp:8
irods
Definition: apiHandler.hpp:35
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
irods::get_irods_default_plugin_directory
boost::filesystem::path get_irods_default_plugin_directory()
Definition: irods_default_paths.cpp:43