Skip to content
Snippets Groups Projects
Commit 17738001 authored by Naumann, Andreas's avatar Naumann, Andreas
Browse files

boost::iostreams truncate bug

parent b9b2cc7b
No related branches found
No related tags found
No related merge requests found
......@@ -29,16 +29,21 @@ namespace AMDiS {
switch (compress) {
case GZIP:
file.push(boost::iostreams::gzip_compressor());
file.push(boost::iostreams::file_descriptor_sink(name.append(".gz")));
name.append(".gz");
break;
case BZIP2:
file.push(boost::iostreams::bzip2_compressor());
file.push(boost::iostreams::file_descriptor_sink(name.append(".bz2")));
name.append(".bz2");
break;
default:
file.push(boost::iostreams::file_descriptor_sink(name));
break;
}
}
{
//boost::iostreams seems not to truncate the file
std::ofstream swapfile(name.c_str(), std::ios::out | std::ios::trunc);
swapfile.close();
}
file.push(boost::iostreams::file_descriptor_sink(name, std::ios::trunc));
writeFileToStream(file);
#else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment