Re: open/write gzipped file
Maybe http://osdab.sourceforge.net/ will be more helpful ??
Re: open/write gzipped file
thanks,
but it looks like another full-blown-zip-archive library - I need only gzipping one file (something more lightweight)
niko
Re: open/write gzipped file
So maybe using QProcess and gzip would be more suitable?
Re: open/write gzipped file
that would be the easiest i guess...
but would work only on unix :(
or does something comparable exist on win32?
Re: open/write gzipped file
Yes, you might use gzip from Cygwin ... I guess ..
Re: open/write gzipped file
sure, that will work
but the users of my application won't be happy about that :D
Re: open/write gzipped file
zlib is fairly lightweight, you may want to try it. http://www.zlib.net/. This is the same compression library that Qt uses, but it doesn't expose the gzip functionality.
Re: open/write gzipped file
i was thinking about that too.
but where to start?
could you give me some hints?
(i have almost no c++ experience)
thanks
niko
Re: open/write gzipped file
zlib is C, not C++. I have never used it directly. My first step would be to read its documentation and look at any example programs. You may also want to look at the qCompress sources to see how Trolltech uses it.
Re: open/write gzipped file
hooray, it works :D
this is how I did it:
Code:
gzFile file;
file = gzopen (fileName.toUtf8().data(), "rb");
if(!file) {
QMessageBox::critical(0, tr
("import"), tr
("Can't open file"));
return;
}
char buffer[1024];
while(int readBytes = gzread (file, buffer, 1024))
{
}
gzclose(file);
thanks for the help....
niko