40 using std::ostringstream;
63 gzFile gsrc = gzopen(src.c_str(),
"rb");
65 string err =
"Could not open the compressed file " + src;
73 int bytes_read = gzread(gsrc, in,
CHUNK);
74 if (bytes_read == 0) {
78 int bytes_written = write(dest_fd, in, bytes_read);
79 if (bytes_written < bytes_read) {
81 strm <<
"Error writing uncompressed data for file " << gsrc <<
": wrote "
82 << bytes_written <<
" instead of " << bytes_read;
exception thrown if inernal error encountered
static void uncompress(const string &src, int dest_fd)
uncompress a file with the .gz file extension