All Questions
15
questions
36
votes
4
answers
35k
views
How to check if a file is gzip compressed?
I have a C / C++ program which needs to read in a file that may or may not be gzip compressed. I know we can use gzread() from zlib to read in both compressed and uncompressed files - however, I want ...
7
votes
1
answer
7k
views
Uncompressed file size using zlib's gzip file access function
Using linux command line tool gzip I can tell the uncompressed size of a compress file using gzip -l.
I couldn't find any function like that on zlib manual section "gzip File Access Functions".
At ...
27
votes
7
answers
30k
views
How to read a .gz file line-by-line in C++?
I have 3 terabyte .gz file and want to read its uncompressed content line-by-line in a C++ program. As the file is quite huge, I want to avoid loading it completely in memory.
Can anyone post a ...
16
votes
5
answers
54k
views
How do I read / write gzipped files in C++?
How do I read / write gzipped files in C++?
The iostream wrapper classes here look good, and here is a simple usage example:
gz::igzstream in(filename);
std::string line;
while(std::getline(in, line)...
15
votes
4
answers
7k
views
How to concat two or more gzip files/streams
I want to concat two or more gzip streams without recompressing them.
I mean I have A compressed to A.gz and B to B.gz, I want to compress them to single gzip (A+B).gz without compressing once again,...
17
votes
1
answer
21k
views
How can I read line-by-line using Boost IOStreams' interface for Gzip files?
I managed to integrate the boost Iostream APIs for reading zipped files. I followed the documentation in boost page and have the following code so-far:
std::stringstream outStr;
ifstream file("...
13
votes
3
answers
20k
views
Is there any cross-platform gzip processor library for C or C++? [closed]
I want some library (API) to open, seek, read, write ... (in one word to process) gzip files. Is there any open-source cross-platform ones for C or C++?
10
votes
1
answer
9k
views
boost gzip decompress byte array
I implemented the gzip/zlib decompression of files as shown in their examples on the boost site.
void CompressionUtils::Inflate(std::ifstream& inputFile,
std::...
11
votes
4
answers
11k
views
Compress string with GZip using qCompress?
I have a string of hex data (0a000a0165787a... etc) that I write to a file like this:
void Output(QString FilePath, QString Output)
{
QFile file(FilePath);
if(!file.open(QIODevice::WriteOnly))...
5
votes
0
answers
2k
views
boost::iostreams, gzip files and tellg
I have been using boost::iostreams for reading an uncompressed text file. In my application, I need multiple file handles (stored in a map) to efficiently buffer data for different parameters stored ...
3
votes
1
answer
9k
views
Uncompress() of 'zlib' returns Z_DATA_ERROR
I made a simple function which takes a gzipped file, and extracts somewhere. For testing purposes i'm using a text file which had been gzipped through a generic utility gzip.
But for some reason the ...
2
votes
1
answer
340
views
How to get gzip_params from boost's gzip_decompressor()
I am using the boost gzip_decompressor() from the following link:
How can I read line-by-line using Boost IOStreams' interface for Gzip files?
Reading the gzip file works fine, but how do I read ...
1
vote
1
answer
706
views
Iterating over mmaped gzip file with boost
I am trying to learn boost and some template programming in C++ but I am really having such an hard time to implement a simple class for iterating over Gzip files using mapped_file_source. I ...
1
vote
1
answer
5k
views
zlib inflate returning a buffer error
I'm trying to decompress a zip file using zlib (without using any extension or 3rd party).
Initially, the src_len is 48756255, and the dest_len is 49209890.
The first pass in the while loop is fine: ...
0
votes
0
answers
336
views
Writing gzipped output file without extra disk space with pipe
I have the following implemented functionality for reading gzipped files without disk usage.
#include <fstream>
#include <stdlib.h> // for mkstemp() and std::system()
#include <memory&...