Skip to content

Commit

Permalink
Fix for writing files using a base destination local dir
Browse files Browse the repository at this point in the history
  • Loading branch information
emi420 committed Feb 20, 2024
1 parent f039cea commit 797d4ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/replicator/replication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,11 @@ void Planet::writeFile(RemoteURL &remote, std::shared_ptr<std::vector<unsigned c
log_error("Destdir corrupted!: %1%, %2%", local_file_path, ex.what());
}
std::ofstream myfile;
myfile.open(remote.filespec, std::ofstream::out | std::ios::binary);
myfile.open(remote.destdir_base + remote.filespec, std::ofstream::out | std::ios::binary);
myfile.write(reinterpret_cast<char *>(data.get()->data()), data.get()->size());
myfile.flush();
myfile.close();
log_debug("Wrote downloaded file %1% to disk from %2%", local_file_path, remote.domain);
log_debug("Wrote downloaded file %1% to disk from %2%", remote.destdir_base + remote.filespec, remote.domain);
}

Planet::~Planet(void)
Expand Down

0 comments on commit 797d4ac

Please sign in to comment.