Commit 63cdd914 authored by Roy Marmelstein's avatar Roy Marmelstein

Improved handling of directories inside a zip file

parent b5a63a0c
......@@ -215,6 +215,9 @@ public class Zip {
guard let filePath = path.path else {
throw ZipError.ZipFail
}
var isDirectory: ObjCBool = false
fileManager.fileExistsAtPath(filePath, isDirectory: &isDirectory)
if !isDirectory {
let input = fopen(filePath, "r")
if input == nil {
throw ZipError.ZipFail
......@@ -262,6 +265,7 @@ public class Zip {
free(buffer)
fclose(input)
}
}
zipClose(zip, nil)
// Completed. Update progress handler.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment