Le 21 avr. 2013 à 7:49, Christian Schmitz a écrit:

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

There's no call (shell or API) to include these 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

This would fail on a setup like mine, where I have replaced the Finder by Path 
Finder (so the Finder doesn't run).
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to