| 470 | } |
| 471 | |
| 472 | bool FileInfo::renameFile(const char* NewName) |
| 473 | { |
| 474 | try { |
| 475 | fs::path old_path = stringToPath(FileName); |
| 476 | fs::path new_path = stringToPath(NewName); |
| 477 | fs::rename(old_path, new_path); |
| 478 | FileName = NewName; |
| 479 | return true; |
| 480 | } |
| 481 | catch (const fs::filesystem_error& e) { |
| 482 | std::clog << "Error in renameFile: " << e.what() << '\n'; |
| 483 | return false; |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | bool FileInfo::copyTo(const char* NewName) const |
| 488 | { |
no test coverage detected