MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / open

Method open

samples/zlib/iostream2/zstream.h:177–182  ·  view source on GitHub ↗

Opens a gzip (.gz) file for writing. * The compression level parameter should be in 0..9 * errno can be checked to distinguish two error cases * (if errno is zero, the zlib error is Z_MEM_ERROR). */

Source from the content-addressed store, hash-verified

175 * (if errno is zero, the zlib error is Z_MEM_ERROR).
176 */
177 void open(const char* name, int level = Z_DEFAULT_COMPRESSION) {
178 char mode[4] = "wb\0";
179 if (level != Z_DEFAULT_COMPRESSION) mode[2] = '0'+level;
180 if (m_fp) close();
181 m_fp = ::gzopen(name, mode);
182 }
183
184 /* open from a FILE pointer.
185 */

Callers

nothing calls this directly

Calls 1

closeFunction · 0.50

Tested by

no test coverage detected