3

I am current working on an Android project.

Since the android apk file is essentially a zip file with a different file extension, is it possible to use zlib to file the directory structure of the asset folder?

The goal is to write some interfaces like opendir() and readdir() so that I can do something like:

DIR* dir = zip_opendir("somedirectory");
struct dirent* entry;
while (0 != (entry = zip_readdir(dir))){
    __android_log_print(ANDROID_LOG_ERROR, "DIR", "entry: %s\n", entry->d_name);
}

except that all the operations take place inside a zip file.

marko
  • 9,029
  • 4
  • 30
  • 46
JasonLi
  • 182
  • 2
  • 8

1 Answers1

1

You can use libzip (which itself uses zlib) to work with zip files. It does all you want and more.

Mark Adler
  • 101,978
  • 13
  • 118
  • 158