Skip to content

Instantly share code, notes, and snippets.

@xxxzhi
Created December 2, 2013 11:32
Show Gist options
  • Save xxxzhi/7748232 to your computer and use it in GitHub Desktop.
Save xxxzhi/7748232 to your computer and use it in GitHub Desktop.
AAssetDir* assetDir = AAssetManager_openDir(mgr, "");
const char* filename = (const char*)NULL;
while ((filename = AAssetDir_getNextFileName(assetDir)) != NULL) {
AAsset* asset = AAssetManager_open(mgr, filename, AASSET_MODE_STREAMING);
char buf[BUFSIZ];
int nb_read = 0;
FILE* out = fopen(filename, "w");
while ((nb_read = AAsset_read(asset, buf, BUFSIZ)) > 0)
fwrite(buf, nb_read, 1, out);
fclose(out);
AAsset_close(asset);
}
AAssetDir_close(assetDir);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment