Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://code.google.com/p/objective-zip/" rel="nofollow">http://code.google.com/p/objective-zip/</a></p> <p><strong>Read file out</strong> </p> <pre><code>ZipFile *unzipFile= [[ZipFile alloc] initWithFileName:@"test.zip" mode:ZipFileModeUnzip]; [unzipFile goToFirstFileInZip]; ZipReadStream *read= [unzipFile readCurrentFileInZip]; NSMutableData *data= [[NSMutableData alloc] initWithLength:256]; int bytesRead= [read readDataWithBuffer:data]; [read finishedReading]; [zipFile close]; </code></pre> <p><strong>List files inside</strong></p> <pre><code>ZipFile *unzipFile= [[ZipFile alloc] initWithFileName:@"test.zip" mode:ZipFileModeUnzip]; NSArray *infos= [unzipFile listFileInZipInfos]; for (FileInZipInfo *info in infos) { NSLog(@"- %@ %@ %d (%d)", info.name, info.date, info.size, info.level); // Locate the file in the zip [unzipFile locateFileInZip:info.name]; // Expand the file in memory ZipReadStream *read= [unzipFile readCurrentFileInZip]; NSMutableData *data= [[NSMutableData alloc] initWithLength:256]; int bytesRead= [read readDataWithBuffer:data]; [read finishedReading]; } [zipFile close]; </code></pre> <p><strong>Note about direcotry structure</strong> </p> <p>Please note that inside the zip files there is no representation of a file-folder hierarchy: it is simply embedded in file names (i.e.: a file with a name like <code>x/y/z/file.txt</code>). It is up to the program that extracts the files to consider these file names as expressing a structure and rebuild it on the file system (and viceversa during creation). Common zippers/unzippers simply follow this rule.</p> <p>from <a href="http://code.google.com/p/objective-zip/wiki/GettingStarted" rel="nofollow">manual</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload