Reputation: 105
I am developing a app like file manager. In this i have created zip folder using any existing folder, it works perfectly fine. For this i have used SSZipArchive API. After zip i send it through mail. It's working fine too.
Now when i try to zip any empty folder, it is not working. Means empty folder does not zip.
Upvotes: 0
Views: 423
Reputation: 832
Isn't a standard thing to have stub files in directories like that. Some file with no contents.
Upvotes: 0
Reputation: 122391
Yeah looking at the source code, the method + createZipFileAtPath:withContentsOfDirectory:
only appears to care about files:
while ((fileName = [dirEnumerator nextObject])) {
BOOL isDir;
NSString *fullFilePath = [directoryPath stringByAppendingPathComponent:fileName];
[fileManager fileExistsAtPath:fullFilePath isDirectory:&isDir];
if (!isDir) {
[zipArchive writeFileAtPath:fullFilePath withFileName:fileName];
}
}
You have two choices:
Upvotes: 0