Opens a gzip (.gz) file for reading. * open() can be used to read a file which is not in gzip format; * in this case read() will directly read from the file without * decompression. errno can be checked to distinguish two error * cases (if errno is zero, the zlib error is Z_MEM_ERROR). */
| 63 | * cases (if errno is zero, the zlib error is Z_MEM_ERROR). |
| 64 | */ |
| 65 | void open(const char* name) { |
| 66 | if (m_fp) close(); |
| 67 | m_fp = ::gzopen(name, "rb"); |
| 68 | } |
| 69 | |
| 70 | void open(FILE* fp) { |
| 71 | SET_BINARY_MODE(fp); |