Acceptable library to extract .Tar files for an iphone application - iphone

please help me to understand that which library will be the best to extract .tar files in an iphone application.
on googling i have found in few posts that libacrchive can be used but another posts says that it will be problematic if you go to upload your app on App store.
Please suggest a suitable library for this purpose.

I write a lib exactly for that: extracting standard tar file without zlib compression.
https://github.com/mhausherr/Light-Untar-for-iOS
My lib take just few lines when libarchive heights 4.7Mb.
Full explanation here: http://blog.octo.com/en/untar-on-ios-the-pragmatic-way/

Related

Dealing with pdf files

I am implementing an application which its main idea is reading books using it.
the pdf files are on my server and I want the user to read the book without saving it on their device.
I thought about streaming the pdf file or embedding it. but it has some difficulties.
So, what is the best solution for this issue?
I am using Django-Rest-framework and Flutter
i think you have to use list of this packages for reading pdf files into flutter.
https://pub.dev/packages/syncfusion_flutter_pdf
https://pub.dev/packages/syncfusion_flutter_pdfviewer

Native swift zip decompression

I would like to implement zip decompression without using external frameworks. I think that Compression framework from iOS SDK should be ok for this, but I'm not sure. I was looking for some examples on how to extract files using this but found nothing. I wan't to extract all files from zip to some directory (not Data object). Can someone help me starting this? Maybe some tutorials I haven't found? Any help will be appreciated.
zlib, which is already there, provides the raw decompression and CRC calculation engines. From there you can write your own code to interpret the zip file structure, which is documented in the PKWare appnote. It is relatively straightforward.

Download and unpack a *.tgz file to a subdirectory of the Documents directory

There very well may be an answer to this already on SO, but I'm not familiar enough with compression formats to know if they're applicable to my case. So here's what I need:
1) Download a *.tgz file that is greater than 200MB.
2) Unpack it to a specified subdirectory of the Documents folder.
I know how to make the connection and begin downloading. But how do I download to an actual file (rather than storing it in memory), and once this download is complete how do I unpack it to my desired location?
To save the downloaded data to a file, see this SO-question and answer(s): The easiest way to write NSData to a file
To uncompress .tgz-files, see this question and answer(s): "Untar" file on iPhone
To download large files, see this question and answer(s): How to download large files using objective c on iphone
(Google is an awesome tool, really.)
Just as a sidenote, an app shouldn't download 200MB of data. It is time- and bandwith consuming and may cause Apple to reject your app.
Forget NSURLConnection; use ASIHTTPConnection (google it) which has an easy save to file option. (And resumes failed downloads too)
I don't know the answer to tar/gzip. My application uses zips instead and http://code.google.com/p/ziparchive/wiki/PageName does the trick.

How to unzip a zip file shared through iTunes from the Application Programmatically?

I need to unzip file synced through itunes in the documents directory programmatically. There are open source frameworks available like ZipArchive and ZipKit but I am not able to use them in the project. Is there a decent tutorial where I can see how to use these frameworks.
you can use SSZipArchive.
It is so simple way to unzip file. please read Readme.markdown (usage).
Simple three lines and that's it.
For ZipKit, you need to use the Better Way of Installing the Framework and follow the Static Library section of the ZipKit Documentation because iOS doesn't allow you to use to embed the Frameworks directly. You need to include it as a Static Library.
Alternatively you could use something lightweight like iZip

"Untar" file on iPhone

I'm writing an iPhone app which downloads a tar-gzipped file from a Webserver, then needs to unarchive this file so that it can be copied into the app's Documents folder.
I'm using tar/gzip because I want to download a whole bunch of small files in one HTTP request, to make everything nice and fast.
I've investigated solutions like http://www.feep.net/libtar/, but as a C/Objective-C newb, I can't get any of them to compile for the iPhone platform.
(I felt like I should just be able to do a system call to "tar -zxvf myfile.tar.gz", but it would appear it's not that easy!)
So is there a simple way to just un-tar a file on the iPhone? Or am I going about this all wrong, and is there a better way to do this?
Thanks in advance!
Nik
This blog post should help you:
http://blog.hawkey.org/?p=332
EDIT: Google cache version of the same page which actually links to a forum post here which links to a Google Code project here, containing some code which implements unzipping on iOS.
Here is a light untar library for iOS : https://github.com/mhausherr/Light-Untar-for-iOS
Complete blog post about the solution : http://blog.octo.com/en/untar-on-ios-the-pragmatic-way/
Hope this helps,
Vincent
I took a different approach by building libarchive and bz2lib as a static library for iOS. You can find it here:
http://github.com/davepeck/iOS-libarchive/