From e72564b27cef35e991ae90ac868c5718fa3bd122 Mon Sep 17 00:00:00 2001 From: Barichello Date: Thu, 17 Feb 2022 18:07:10 -0300 Subject: Revert "Fix corrupted zipped logs (#76)" This reverts commit 37212a4d0cb59929af6366b48d0a8cc110f06912. Reverting this in favor of deletion i guess --- NorthstarDedicatedTest/logCompression.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'NorthstarDedicatedTest') diff --git a/NorthstarDedicatedTest/logCompression.cpp b/NorthstarDedicatedTest/logCompression.cpp index 5c170de3..d9e89fdf 100644 --- a/NorthstarDedicatedTest/logCompression.cpp +++ b/NorthstarDedicatedTest/logCompression.cpp @@ -17,6 +17,7 @@ using namespace std; bool compressFile(const fs::path path) { // read log file + ofstream output; string filename(path.string()); cout << "Compressing : '" + filename + "'" << endl; ifstream input(filename, ios_base::binary); @@ -30,13 +31,13 @@ bool compressFile(const fs::path path) // compress log file string compressed_data = gzip::compress(log_data.data(), log_data.size()); // write log file gzip - ofstream output(filename + ".gz", ios::out | ios::binary); - if (!output) + output.open(filename + ".gz"); + if (!output.is_open()) { cerr << "Could not write : '" + filename + "'" << endl; return false; } - output.write(compressed_data.c_str(), compressed_data.size()); + output << compressed_data; output.close(); // delete log file remove(path); -- cgit v1.2.3