| 625 | } |
| 626 | |
| 627 | void WriteConfigToFile(std::string strKey, std::string strValue) |
| 628 | { |
| 629 | std::ifstream fin(GetConfigFile().string().c_str()); |
| 630 | std::string line; |
| 631 | std::stringstream ss; |
| 632 | ss << strKey << "=" << strValue << endl; |
| 633 | while (std::getline(fin, line)) { |
| 634 | if(line.length() > 0 && line.find(strKey) == std::string::npos) { |
| 635 | ss << line << endl; |
| 636 | } |
| 637 | } |
| 638 | fin.close(); |
| 639 | std::ofstream fout(GetConfigFile().string().c_str()); |
| 640 | fout << ss.str() << endl; |
| 641 | fout.close(); |
| 642 | ss.clear(); |
| 643 | } |
| 644 | #ifndef WIN32 |
| 645 | boost::filesystem::path GetPidFile() |
| 646 | { |