Skip to content

Instantly share code, notes, and snippets.

@dendisuhubdy
Created September 30, 2021 01:23
Show Gist options
  • Save dendisuhubdy/f07923fd32f544e57887e4b8ff78b855 to your computer and use it in GitHub Desktop.
Save dendisuhubdy/f07923fd32f544e57887e4b8ff78b855 to your computer and use it in GitHub Desktop.
tar.cpp
#define BUF_SZ 16384
void my_gunzip(gzFile_s *src, FILE *dest) {
unsigned char buf[BUF_SZ];
for (auto sz = gzread(src, buf, BUF_SZ); sz > 0; sz = gzread(src, buf, BUF_SZ) {
std::fwrite(buf, 1, BUF_SZ, dest);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment