diff --git a/src/vlog/common/edb.cpp b/src/vlog/common/edb.cpp index 407a43d9..f03947b6 100644 --- a/src/vlog/common/edb.cpp +++ b/src/vlog/common/edb.cpp @@ -123,10 +123,17 @@ void EDBLayer::addInmemoryTable(const EDBConf::Table &tableConf) { infot.id = (PredId_t) predDictionary->getOrAdd(pn); infot.type = tableConf.type; string repository = tableConf.params[0]; +#if defined(_WIN32) + if (repository.size() <= 1 || repository[1] != ':') { + //Relative path. Add the root path + repository = rootPath + DIR_SEP + repository; + } +#else if (repository.size() > 0 && repository[0] != '/') { //Relative path. Add the root path repository = rootPath + "/" + repository; } +#endif InmemoryTable *table; if (tableConf.params.size() == 2) { table = new InmemoryTable(repository, diff --git a/src/vlog/inmemory/inmemorytable.cpp b/src/vlog/inmemory/inmemorytable.cpp index 28f9636e..ae5c7079 100644 --- a/src/vlog/inmemory/inmemorytable.cpp +++ b/src/vlog/inmemory/inmemorytable.cpp @@ -95,7 +95,7 @@ InmemoryTable::InmemoryTable(std::string repository, std::string tablename, if (repository == "") { repository = "."; } - std::string tablefile = repository + "/" + tablename + ".csv"; + std::string tablefile = repository + DIR_SEP + tablename + ".csv"; std::string gz = tablefile + ".gz"; istream *ifs = NULL; if (Utils::exists(gz)) { @@ -143,7 +143,7 @@ InmemoryTable::InmemoryTable(std::string repository, std::string tablename, } delete ifs; } else { - tablefile = repository + "/" + tablename + ".nt"; + tablefile = repository + DIR_SEP + tablename + ".nt"; std::string gz = tablefile + ".gz"; FileInfo f; f.start = 0; @@ -156,7 +156,7 @@ InmemoryTable::InmemoryTable(std::string repository, std::string tablename, f.path = tablefile; f.splittable = true; } else { - std::string e = "While importing data for predicate \"" + layer->getPredName(predid) + "\": could not open file " + tablefile + " nor " + (repository + "/" + tablename + ".csv") + " nor gzipped versions"; + std::string e = "While importing data for predicate \"" + layer->getPredName(predid) + "\": could not open file " + tablefile + " nor " + (repository + DIR_SEP + tablename + ".csv") + " nor gzipped versions"; LOG(ERRORL) << e; segment = NULL; throw(e); diff --git a/src/vlog/java/native/VLog.cpp b/src/vlog/java/native/VLog.cpp index ced496d1..33e376da 100644 --- a/src/vlog/java/native/VLog.cpp +++ b/src/vlog/java/native/VLog.cpp @@ -288,6 +288,9 @@ extern "C" { f = new VLogInfo(); try { EDBConf conf(crawconf.c_str(), isfile); + if (isfile) { + conf.setRootPath(Utils::parentDir(crawconf)); + } try { f->layer = new EDBLayer(conf, false);