| 25 | } |
| 26 | |
| 27 | void copyFile(IDisk & from_disk, const String & from_path, IDisk & to_disk, const String & to_path) |
| 28 | { |
| 29 | LOG_DEBUG(&Poco::Logger::get("IDisk"), "Copying from {} (path: {}) {} to {} (path: {}) {}.", |
| 30 | from_disk.getName(), from_disk.getPath(), from_path, to_disk.getName(), to_disk.getPath(), to_path); |
| 31 | |
| 32 | auto in = from_disk.readFile(from_path); |
| 33 | auto out = to_disk.writeFile(to_path); |
| 34 | copyData(*in, *out); |
| 35 | out->finalize(); |
| 36 | } |
| 37 | |
| 38 | |
| 39 | using ResultsCollector = std::vector<std::future<void>>; |