Index: trunk/FACT++/src/Configuration.cc
===================================================================
--- trunk/FACT++/src/Configuration.cc	(revision 19384)
+++ trunk/FACT++/src/Configuration.cc	(revision 19385)
@@ -331,6 +331,4 @@
 #include <iostream>
 #include <iomanip>
-
-#include <boost/filesystem.hpp>
 
 #ifdef HAVE_SQL
@@ -492,9 +490,4 @@
         ;
 
-    po::options_description def_config;
-    def_config.add_options()
-        ("default",  var<string>(fName+string(".rc")), "Default configuration file.")
-        ;
-
     po::options_description config("Configuration options");
     config.add_options()
@@ -502,9 +495,10 @@
         ("database",    var<string>(), "Database link as in\n\t[user[:password]@]server.com[:port]/database[?compress=0|1]\nOverwrites options from the default configuration file.")
         ("no-database",                "Suppress any access to the database even if a database URL was set.")
+        ("default",     var<string>(fName+string(".rc")), "Default configuration file.")
+        ("prefix",      var<string>(), "Path to default configuration file.")
         ;
 
     fOptionsCommandline[kVisible].add(generic);
     fOptionsCommandline[kVisible].add(config);
-    fOptionsCommandline[kVisible].add(def_config);
     fOptionsConfigfile[kVisible].add(config);
 }
@@ -981,4 +975,5 @@
 
     fPriorityFile = "";
+    fPrefixPath   = "";
     fDefaultFile  = "";
     fDatabase     = "";
@@ -1054,8 +1049,9 @@
     const string globalfile = (path.parent_path()/boost::filesystem::path("fact++.rc")).string();
 
-    cerr << "Reading global  options from '" << globalfile << "'." << endl;
+
+    errno = 0;
 
     ifstream gfile(globalfile.c_str());
-    // ===> FIXME: Proper handling of missing file or wrong file name
+    cerr << "Reading global  options from '" << globalfile << "' [" << strerror(errno) << "]" << endl;
     const po::parsed_options parsed_globalfile =
         !gfile ?
@@ -1068,10 +1064,15 @@
 #endif
 
+    po::store(parsed_globalfile, getfiles);
+
+    // Get default prefix path from command line
+    if (getfiles.count("prefix"))
+        fPrefixPath = getfiles["prefix"].as<string>();
+
     // Get default file from command line
     if (getfiles.count("default"))
-    {
         fDefaultFile = getfiles["default"].as<string>();
-        cerr << "Reading default options from '" << fDefaultFile << "'." << endl;
-    }
+
+    const string default_file = (boost::filesystem::path(fPrefixPath)/boost::filesystem::path(fDefaultFile)).string();
 
     const bool checkf    = !getfiles.count("dont-check-files") && !getfiles.count("dont-check");
@@ -1079,6 +1080,9 @@
     //const bool exists    = boost::filesystem::exists(fDefaultFile);
 
-    ifstream indef(fDefaultFile.c_str());
-    // ===> FIXME: Proper handling of missing file or wrong file name
+    errno = 0;
+
+    ifstream indef(default_file);
+    if (!fDefaultFile.empty())
+        cerr << "Reading default options from '" << default_file << "' [" << strerror(errno) << "]" << endl;
     const po::parsed_options parsed_defaultfile =
         !indef && defaulted ?
@@ -1114,8 +1118,11 @@
     {
         fPriorityFile = getfiles["config"].as<string>();
-        cerr << "Reading config options from '" << fPriorityFile << "'." << endl;
+        cerr << "Reading config  options from '" << fPriorityFile << "'." << endl;
     }
 
     ifstream inpri(fPriorityFile.c_str());
+    if (!fPriorityFile.empty() && !inpri)
+        throw runtime_error("Reading '"+fPriorityFile+"' failed: "+strerror(errno));
+
     // ===> FIXME: Proper handling of missing file or wrong file name
     const po::parsed_options parsed_priorityfile =
Index: trunk/FACT++/src/Configuration.h
===================================================================
--- trunk/FACT++/src/Configuration.h	(revision 19384)
+++ trunk/FACT++/src/Configuration.h	(revision 19385)
@@ -4,4 +4,5 @@
 #include <iostream>
 #include <boost/program_options.hpp>
+#include <boost/filesystem.hpp>
 
 namespace po = boost::program_options;
@@ -36,4 +37,5 @@
 
     std::string fPriorityFile;  /// File name of the priority configuration file (overwrites option from the databse)
+    std::string fPrefixPath;    /// Path to the default configuration file
     std::string fDefaultFile;   /// File name of the default configuration file (usually {program}.rc)
     std::string fDatabase;      /// URL for database connection (see Configuration::parse_database)
@@ -204,4 +206,11 @@
     }
 
+    const std::string GetPrefixedString(const std::string &var)
+    {
+        const boost::filesystem::path ff(Get<std::string>(var));
+        const boost::filesystem::path pp(fPrefixPath);
+        return (ff.has_parent_path() ? ff : pp/ff).string();
+    }
+
 /*
     template<class T>
@@ -234,4 +243,5 @@
 */
     const std::string &GetName() const { return fName; }
+    const boost::filesystem::path GetPrefixPath() const { return fPrefixPath; }
 };
 
