Lines 14-20
Link Here
|
14 |
#include <fstream> |
14 |
#include <fstream> |
15 |
#include <stdexcept> |
15 |
#include <stdexcept> |
16 |
#include <cstring> |
16 |
#include <cstring> |
17 |
|
17 |
#include <limits.h> |
|
|
18 |
#include <stdlib.h> |
18 |
#include "conversion.h" |
19 |
#include "conversion.h" |
19 |
#include "util.h" |
20 |
#include "util.h" |
20 |
#include "leak_dumper.h" |
21 |
#include "leak_dumper.h" |
Lines 38-47
Link Here
|
38 |
|
39 |
|
39 |
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str()); |
40 |
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str()); |
40 |
|
41 |
|
41 |
fileStream.open(path.c_str(), ios_base::in); |
42 |
char str[PATH_MAX]; |
|
|
43 |
snprintf(str, PATH_MAX, "%s/.megaglest/%s", getenv("HOME"), path.c_str()); |
44 |
fileStream.open(str, ios_base::in); |
42 |
if(fileStream.fail()){ |
45 |
if(fileStream.fail()){ |
43 |
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str()); |
46 |
fileStream.open(path.c_str(), ios_base::in); // use defaults |
44 |
throw runtime_error("Can't open propertyMap file: " + path); |
47 |
if(fileStream.fail()){ |
|
|
48 |
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str()); |
49 |
throw runtime_error("Can't open propertyMap file: " + path + " cwd: "+ getenv("PWD")); |
50 |
} |
45 |
} |
51 |
} |
46 |
|
52 |
|
47 |
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str()); |
53 |
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str()); |
Lines 78-84
Link Here
|
78 |
void Properties::save(const string &path){ |
84 |
void Properties::save(const string &path){ |
79 |
ofstream fileStream; |
85 |
ofstream fileStream; |
80 |
|
86 |
|
81 |
fileStream.open(path.c_str(), ios_base::out | ios_base::trunc); |
87 |
char str[PATH_MAX]; |
|
|
88 |
snprintf(str, PATH_MAX, "%s/.megaglest/%s", getenv("HOME"), path.c_str()); |
89 |
fileStream.open(str, ios_base::out | ios_base::trunc); |
82 |
|
90 |
|
83 |
fileStream << "; === propertyMap File === \n"; |
91 |
fileStream << "; === propertyMap File === \n"; |
84 |
fileStream << '\n'; |
92 |
fileStream << '\n'; |