Sunday, October 2, 2022
HomeiOS Developmentios - Similar file being reportes with two completely different sizes

ios – Similar file being reportes with two completely different sizes


I’ve this sqlite file within the bundle. This file is copied to Software Assist.

At a sure level, I’ve to test if the file within the bundle is similar on Software Assist. I test that by evaluating the file measurement:

So I’ve this code:

let path = Bundle.most important.path(forResource: Database.DatabaseName, ofType: "sqlite")
    
var fileSize : UInt64
let attr:NSDictionary? = attempt! fileManager.attributesOfItem(atPath: sqlite.path) as NSDictionary
if let _attr = attr {
  fileSize = _attr.fileSize()
  print(fileSize)
}
    
var fileSize2 : UInt64
let attr2:NSDictionary? = attempt! fileManager.attributesOfItem(atPath: path!) as NSDictionary
if let _attr2 = attr2 {
  fileSize2 = _attr2.fileSize()
  print(fileSize2)
}

fileSize (the one from the bundle) is reported incorrectly as 24576 and fileSize2, with the true file measurement reported by finder, 229376.

What’s going on right here? Is the one within the bundle compressed or one thing?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments