Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions include/builders/external_memory_builder_partitioned_phf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ struct external_memory_builder_partitioned_phf {

struct meta_partition {
meta_partition(std::string const& dir_name, uint64_t id)
: m_filename(dir_name + "/pthash.temp." + std::to_string(id)), m_size(0) {}
: m_filename(dir_name + "/pthash.temp." + std::to_string(id)), m_size(0) {
// Truncate the file if it exists from a previous run
std::ofstream truncate(m_filename.c_str(), std::ofstream::binary | std::ofstream::trunc);
truncate.close();
}

void push_back(hash_type hash) {
m_hashes.push_back(hash);
Expand Down Expand Up @@ -322,4 +326,4 @@ struct external_memory_builder_partitioned_phf {
};
};

} // namespace pthash
} // namespace pthash
Loading