| 417 | } |
| 418 | |
| 419 | ACTOR static Future<Void> openFileImpl(DecodeProgress* self, Reference<IBackupContainer> container) { |
| 420 | Reference<IAsyncFile> fd = wait(container->readFile(self->file.fileName)); |
| 421 | self->fd = fd; |
| 422 | if (self->save) { |
| 423 | std::string dir = self->file.fileName; |
| 424 | std::size_t found = self->file.fileName.find_last_of('/'); |
| 425 | if (found != std::string::npos) { |
| 426 | std::string path = self->file.fileName.substr(0, found); |
| 427 | if (!directoryExists(path)) { |
| 428 | platform::createDirectory(path); |
| 429 | } |
| 430 | } |
| 431 | self->lfd = open(self->file.fileName.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0600); |
| 432 | if (self->lfd == -1) { |
| 433 | TraceEvent(SevError, "OpenLocalFileFailed").detail("File", self->file.fileName); |
| 434 | throw platform_error(); |
| 435 | } |
| 436 | } |
| 437 | while (!self->eof) { |
| 438 | wait(readAndDecodeFile(self)); |
| 439 | } |
| 440 | return Void(); |
| 441 | } |
| 442 | |
| 443 | // Add chunks to mutationBlocksByVersion |
| 444 | void addBlockKVPairs(VectorRef<KeyValueRef> chunks) { |
nothing calls this directly
no test coverage detected