| 79 | } |
| 80 | |
| 81 | void HashFS::rehash_file(const std::filesystem::path& path, bool report) { |
| 82 | if (file_is_hashable(path)) { |
| 83 | std::string hash; |
| 84 | if (hashFile(path, hash) != Error::Ok) { |
| 85 | delete_file(path, false); |
| 86 | } else { |
| 87 | localFsHashes[path.filename().string()] = hash; |
| 88 | } |
| 89 | } |
| 90 | if (report) { |
| 91 | report_change(); |
| 92 | } |
| 93 | } |
| 94 | void HashFS::rename_file(const std::filesystem::path& ipath, const std::filesystem::path& opath, bool report) { |
| 95 | delete_file(ipath, false); |
| 96 | rehash_file(opath, report); |