You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to download file and unarchive it in my app. The problem is that sometimes Lzma works perfectly but most of the time I am getting this error in console:
LZMA DEBUG 72: ERROR: code = 1, file = '/Users/piotrek/Development/zarazjade_mac/Pods/LzmaSDK-ObjC/src/LzmaSDKObjCFileDecoder.cpp', line = 146, description = Can't open archive file with result: 1
Can't open archive: Can't open archive file with result: 1
There is a code that unzip my file:
guard let fileURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else { return }
let reader = LzmaSDKObjCReader(fileURL: fileURL.appendingPathComponent(lastFile.name), andType: LzmaSDKObjCFileType7z)
reader.delegate = self
reader.passwordGetter = {
return ""
}
do {
try reader.open()
var items = [LzmaSDKObjCItem]()
reader.iterate(handler: { (item, error) -> Bool in
items.append(item)
return true
})
if reader.extract(items, toPath: "/Users/piotrek/Documents/", withFullPaths: true) {
print("Extract failed: \(reader.lastError?.localizedDescription)")
}
} catch let error as NSError {
print("Can't open archive: \(error.localizedDescription) ")
}
I will be glad for help.
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to download file and unarchive it in my app. The problem is that sometimes Lzma works perfectly but most of the time I am getting this error in console:
There is a code that unzip my file:
I will be glad for help.
The text was updated successfully, but these errors were encountered: