mirror of
https://gitea.home.endeavr.de/Marcel/Tarstats-pp.git
synced 2025-12-10 00:39:01 +01:00
this added OS implementation of zlib. this also prototyped extracting the first 512 bytes of a tar.gz file and displaying the content of the first 100 bytes (name of the first file in the tarball)
This commit is contained in:
6
main.cpp
6
main.cpp
@@ -68,6 +68,12 @@ int main(int argc, char** argv) {
|
||||
test.close();
|
||||
if (x == '\213')
|
||||
std::cout << "success" << std::endl;
|
||||
gzFile gzIn = gzopen("test4.tar.gz", "rb");
|
||||
gzbuffer(gzIn, 512);
|
||||
char* testbuf = new char[512];
|
||||
gzread(gzIn, testbuf, 512);
|
||||
std::string teststr (&testbuf[0], 100);
|
||||
std::cout << teststr << '\n';
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user