Hi, I have a code block trying to output a series of gzip files. I wish to have all the files flushed after the block. But the files can only be flushed after exiting the whole program. The files still have zero size after I try to close them. I am using std::vector to store all the pointers to boost filtering_ostream. Can you help? //Open iostreams char filename[20]; std::vector<boost::iostreams::filtering_ostream *> os_vector; for(i=0; i<4; i++) { sprintf(filename, "file_%d.gz", i ); std::ofstream *of = new std::ofstream(filename, std::ios_base::binary); boost::iostreams::filtering_ostream* os = new boost::iostreams::filtering_ostream; os->push(boost::iostreams::gzip_compressor()); os->push(*of); os_vector->push_back(os); } //Output something for(i=0; i<4; i++) { boost::iostreams::filtering_ostream* os = os_vector[i]; os<<"Output something here" << std::endl; } //Close streams for(i=0; i<4; i++) { boost::iostreams::filtering_ostream* os = os_vector[i]; os->strict_sync(); os->pop(); os->reset(); } Thanks, Mengda