On 21.04.2013, at 03:21, Scott Crick <[email protected]> wrote:

> When I use FolderItem.PhysicalFileTotalLengthMBS, the size of this file is 
> returned as 331776 bytes. When I divide this by 1024, I get 324 KB. If I 
> divide it by 1000, I get 331 KB. Neither of these is what the Finder is 
> reporting—339 KB.

FolderItem.PhysicalFileTotalLengthMBS is the size of resource fork and data 
fork.
It does not count extended attributes.

> Is there a different function I should be using? I need to get the size as 
> it's reported in the Finder.


You could ask the Finder for file size with AppleEvents/AppleScripts. Like this:

on getSizeInBytesFromPosixPath(posixPath)
try
        set b to (POSIX file posixPath) as string
        tell application "Finder" to return size of (b as alias)
on error
        return 0
end try
end getSizeInBytesFromPosixPath


Greetings
Christian

-- 
Read our blog about news on our plugins:

http://www.mbsplugins.de/

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to