Page 1 of 1

Extracting gz compressed file.

Posted: Wed Nov 09, 2011 11:07 pm
by jassing
Couldn't search the forum -- 'gz' is too small.
Using google, I either ended up on either a unix, PureZIP, or ZLib/purebasic page(zlib's example didn't work.)

I have to download a file on a regular basis and then extract/process the file but it is a .gz compressed file.

Other than shelling out to a gunzip util/port -- any ideas?

Thanks
-josh

Re: Extracting gz compressed file.

Posted: Thu Nov 10, 2011 3:55 am
by IdeasVacuum
If it is always the same file, you can just hard-code the gzip command. Otherwise, since the gzip file name is the same as the original file, your app can extract the file name from the .gz file and then concat the command.

Code: Select all

RunProgram("C:\Program Files\GnuWin32\bin\gzip","-d C:\MyGzipFiles\SampleFile.txt.gz","",#PB_Program_Wait)

MessageRequester("Done", "Done")

End
Tested on WinXP 32bit. You can of course use other decompression apps such as WinRar in the same way.

Re: Extracting gz compressed file.

Posted: Thu Nov 10, 2011 9:37 am
by gnozal
Hi,

you may try the following include + static ZLIB : http://gnozal.ucoz.com/PBLIB_ZLIB_Stati ... c_GZip.zip

Re: Extracting gz compressed file.

Posted: Thu Nov 10, 2011 3:28 pm
by jassing
Thanks! I'll check the dll.

-j