| 89 | } |
| 90 | |
| 91 | void FileReceiver::SaveFile() { |
| 92 | std::string full_path = path_ + file_name_; |
| 93 | std::string tmp_file_path = full_path + ".tmp"; |
| 94 | if (::fedb::base::IsExists(full_path)) { |
| 95 | std::string backup_file = full_path + "." + ::fedb::base::GetNowTime(); |
| 96 | rename(full_path.c_str(), backup_file.c_str()); |
| 97 | } |
| 98 | rename(tmp_file_path.c_str(), full_path.c_str()); |
| 99 | PDLOG(INFO, "file %s received. size %lu", full_path.c_str(), size_); |
| 100 | } |
| 101 | |
| 102 | } // namespace tablet |
| 103 | } // namespace fedb |
no test coverage detected