//cout << "Total objects to read = " << nobjects << endl;
if ( sgReadError() ) {
- cout << "We detected an error while reading the file header" << endl;
+ cout << "Error while reading header of file " << file << "(.gz)" << endl;
return false;
}
}
if ( sgReadError() ) {
- cout << "We detected an error while reading object:" << i << endl;
+ cout << "Error while reading object:" << i << " in file " << file << "(.gz)" << endl;
return false;
}
}
gzclose(fp);
if ( sgReadError() ) {
- cout << "We detected an error while reading the file." << endl;
+ cout << "Error while reading file " << file << "(.gz)" << endl;
return false;
}
gzclose(fp);
if ( sgWriteError() ) {
- cout << "We detected an error while writing the file." << endl;
+ cout << "Error while writing file " << file.str() << endl;
return false;
}
fclose(fp);
string command = "gzip --force --best " + file.str();
- system(command.c_str());
+ int err = system(command.c_str());
+ if (err)
+ {
+ cout << "ERROR: gzip " << file.str() << " failed!" << endl;
+ }
- return true;
+ return (err == 0);
}
void SGBinObject::read_properties(gzFile fp, int nproperties)