|
@@ -2,6 +2,9 @@
|
|
|
#include <assert.h>
|
|
|
#include <fstream>
|
|
|
|
|
|
+#include <unistd.h> //for getpwd() under linux
|
|
|
+#include <sys/param.h> //for MAXPATHLEN - the maximal path length
|
|
|
+
|
|
|
// nice-core includes
|
|
|
#include "core/basics/Exception.h"
|
|
|
#include "core/basics/Config.h"
|
|
@@ -35,7 +38,21 @@ Config::Config ( int argc,
|
|
|
{
|
|
|
readFromArguments ( argc, argv );
|
|
|
std::string configfile = gS("main", "config", "" );
|
|
|
-
|
|
|
+
|
|
|
+ NICE::FileName t_ConfigFilename( configfile );
|
|
|
+
|
|
|
+ // check for relative path correction:
|
|
|
+ // if dataset is a relative path, then make it absolute using the
|
|
|
+ // currend working directory
|
|
|
+ if( t_ConfigFilename.isRelative() )
|
|
|
+ {
|
|
|
+ char sCWDPath[MAXPATHLEN];
|
|
|
+ getcwd(sCWDPath, MAXPATHLEN);
|
|
|
+ t_ConfigFilename.set( string(sCWDPath) + "/" + configfile );
|
|
|
+ t_ConfigFilename.convertToRealPath();
|
|
|
+ configfile = t_ConfigFilename.str();
|
|
|
+ }
|
|
|
+ m_sConfigFilename = configfile;
|
|
|
std::cerr << "configfile: " << configfile << std::endl;
|
|
|
ioUntilEndOfFile = gB("main", "ioUntilEndOfFile", true );
|
|
|
if ( configfile.size() > 0 )
|