Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::stringstream ss;
- std::string str;
- std::fstream fs("/var/local/app/stats/app_start_count", std::ios::in | std::ios::out);
- if(fs >> str)
- {
- if(ss << str)
- {
- uint32_t app_start_count;
- if(ss >> app_start_count)
- {
- ++app_start_count;
- LOG4CXX_INFO(gLogger, "Application start count: " << app_start_count);
- fs.seekp(0);
- if(fs << app_start_count)
- {
- LOG4CXX_INFO(gLogger, "write successful");
- }
- else
- {
- LOG4CXX_INFO(gLogger, "write failed");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment