@eskimo I'm afraid that doesn't help. Did you mean to grab it some other way? I tested it un-sandboxed too btw and the file kind appears normally but the size is still incorrect. I went into detail on what I've tried on Stack Overflow
var fileResources: URLResourceValues?
let keys: Set<URLResourceKey> = [
.localizedTypeDescriptionKey,
.fileSizeKey,
]
DispatchQueue.global(qos: .background).async {
do {
guard let resources = try self.url?.resourceValues(forKeys: keys) else { return }
self.fileResources = resources
}
catch {}
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
print(self.fileResources?.localizedTypeDescription)
print(self.fileResources?.fileSize)
}
}
Topic:
Programming Languages
SubTopic:
Swift
Tags: