SHARE
TWEET
Untitled
a guest
Nov 21st, 2018
101
Never
- #include <stdio.h>
- #include <stdlib.h>
- #include <zlib.h>
- int main(int argc, const char **argv) {
- if (argc < 2) {
- fprintf(stderr, "Error: You must pass an input file\n");
- exit(-1);
- }
- gzFile fp = gzopen(argv[1], "r");
- if (!fp) {
- fprintf(stderr, "Error: Cannot open file '%s'\n", argv[1]);
- exit(-1);
- }
- char buf[32768];
- size_t len;
- while ((len = gzread(fp, buf, sizeof(buf))) > 0) {
- buf[len] = '\0';
- printf("%s", buf);
- }
- gzclose(fp);
- return 0;
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.


