Previous | Index | Next |
URL and File related methods
sizeInfoForFile:
Takes an alias, file, HFS path, POSIX path or NSURL and returns a dictionary/record.
For files, the values are returned like this: {totalFileSize:94927, totalFileAllocatedSize:98304, fileAllocatedSize:98304, fileSize:94927}
+ (NSDictionary *)sizeInfoForFile:(id)fileAliasOrPath
fileAliasOrPath = alias, file, HFS path, POSIX path or NSURL
Dictionary/record. The "total" values include metadata; "Allocated" means disk space used. Finder reports totalFileSize.
For directories and packages, only the total values are returned: {totalFileSize:271230605, totalFileAllocatedSize:286121984}.
Version 1.0.0
use scripting additions
use framework "Foundation"
use script "BridgePlus"
load framework
set fileAliasOrPath to "~/Desktop/Test/IMG_0829.JPG"
set theResult to current application's SMSForder's sizeInfoForFile:fileAliasOrPath
ASify from theResult
--> {totalFileSize:1867090, totalFileAllocatedSize:1867776, fileAllocatedSize:1867776, fileSize:1867090}
theResult as record
--> {totalFileSize:1867090, totalFileAllocatedSize:1867776, fileAllocatedSize:1867776, fileSize:1867090}