Previous Index Next

BridgePlus.framework, SMSForder Class Methods

Category

URL and File related methods

Method

sizeInfoForFile:

Summary

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}

Signature

+ (NSDictionary *)sizeInfoForFile:(id)fileAliasOrPath

Parameters

fileAliasOrPath = alias, file, HFS path, POSIX path or NSURL

Result

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}.

Availability

Version 1.0.0

Notes

 

Sample

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}



Click here to open script in a script editor