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
Extracting gz compressed file.
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Extracting gz compressed file.
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.
Tested on WinXP 32bit. You can of course use other decompression apps such as WinRar in the same way.
Code: Select all
RunProgram("C:\Program Files\GnuWin32\bin\gzip","-d C:\MyGzipFiles\SampleFile.txt.gz","",#PB_Program_Wait)
MessageRequester("Done", "Done")
End
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
gnozal
- PureBasic Expert

- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: Extracting gz compressed file.
Hi,
you may try the following include + static ZLIB : http://gnozal.ucoz.com/PBLIB_ZLIB_Stati ... c_GZip.zip
you may try the following include + static ZLIB : http://gnozal.ucoz.com/PBLIB_ZLIB_Stati ... c_GZip.zip
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: Extracting gz compressed file.
Thanks! I'll check the dll.
-j
-j
