diff --git a/tools/analyse.cpp b/tools/analyse.cpp index efb84b4..c2ea8fa 100644 --- a/tools/analyse.cpp +++ b/tools/analyse.cpp @@ -192,9 +192,6 @@ int main (int argc, char const **argv) std::cerr << p << '\n'; - std::ofstream output (argv[ARGS_OUTPUT], std::ios::out | std::ios::trunc); - output.exceptions (std::ios::badbit | std::ios::eofbit | std::ios::failbit); - // Find all the chunks and prepare them for output std::cout << "processing\n"; std::vector src = find_chunks (argv[ARGS_INPUT], p); @@ -203,6 +200,8 @@ int main (int argc, char const **argv) std::sort (src.begin (), src.end (), region_less); // Write all chunks to the output file + std::ofstream output (argv[ARGS_OUTPUT], std::ios::out | std::ios::trunc); + output.exceptions (std::ios::badbit | std::ios::eofbit | std::ios::failbit); output << "params: " << p << '\n'; for (auto const &chunk: src) { output << chunk.size() << ' ';