I've got a file, bigfile.gz, in the bundle of my iPhone app. At app start, I want to gunzip that file to my Documents directory within my app. How can I achieve this programmatically?
Basically I want the effect of: gunzip bigfile.gz
.. obviously a gunzip
utility is not available in the iOS environment though.
There are many free apps on the market to unzip a GZ file on your PC. 7-Zip is a pretty good choice for this task, as it's easy, free, and open-source. Here's how you use this app to decompress GZ archives on your PC: Download and install the free 7-Zip tool on your PC.
How to Compress a File or Folder on iPhone and iPad. Launch the Files app on your iPhone or iPad. Find the file or folder that you want to compress. Press and hold on the file or folder, then select Compress from the contextual menu.
As pointed out in this post:
Compression API on the iPhone
both zlib and bzip2 are available. However, as another answer there points out, if you store the data for the conversations in an NSData
object, then you can use an NSData
category that adds gzip and zlib compression / decompression as simple methods. Here's a useful link for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With