weichsel / ZIPFoundation

Effortless ZIP Handling in Swift
MIT License
2.34k stars 262 forks source link

What is the most efficient way to validate a compressed ZIP file #279

Closed DikeyKing closed 1 year ago

DikeyKing commented 1 year ago

What is the most efficient way to validate a compressed ZIP file? Is there a method similar to validate that can be used for this purpose?

A method looks like this:

func validateZipFile(at zipFileURL: URL) -> Bool {
    guard let archive = Archive(url: zipFileURL, accessMode: .read) else { return false }
    let validationResult = archive.validate()
    return validationResult == .success
}
DikeyKing commented 1 year ago

https://stackoverflow.com/questions/76456096/what-is-the-most-efficient-way-to-validate-a-compressed-zip-file-when-using-zipf

Solved