Skip to content

Commit

Permalink
Debug zipping
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Sep 22, 2024
1 parent 465c1ab commit b5a4849
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Zip/Zip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -249,21 +249,20 @@ public class Zip {
_ = FileManager.default.fileExists(atPath: filePath, isDirectory: &isDirectory)
if !isDirectory.boolValue {
guard let input = fopen(filePath, "r") else {
print("XXXXXXXXXXXXXXXXX - 1")
throw ZipError.zipFail
}
defer { fclose(input) }
let fileName = path.fileName
var zipInfo: zip_fileinfo = zip_fileinfo(dos_date: 0, internal_fa: 0, external_fa: 0)
do {
let fileAttributes = try FileManager.default.attributesOfItem(atPath: filePath)
if let fileDate = fileAttributes[FileAttributeKey.modificationDate] as? Date {
zipInfo.dos_date = fileDate.dosDate
}
if let fileSize = fileAttributes[FileAttributeKey.size] as? Double {
currentPosition += fileSize
}
} catch {}
guard let buffer = malloc(chunkSize) else {
print("XXXXXXXXXXXXXXXXX - 2")
throw ZipError.zipFail
}
if let password, let fileName {
Expand All @@ -281,6 +280,7 @@ public class Zip {
nil, 0
)
} else {
print("XXXXXXXXXXXXXXXXX - 3")
throw ZipError.zipFail
}
var length: Int = 0
Expand Down

0 comments on commit b5a4849

Please sign in to comment.