Re: [MBS] Matching File Size as Shown in Finder

2013-04-22 Thread Steve Upton
On Apr 21, 2013, at 5:13 PM, Scott Crick li...@searchwaresolutions.com wrote: On Apr 20, 2013, at 8:21 PM, Scott Crick li...@searchwaresolutions.com wrote: For example, I have a PDF file that, in the Finder, shows as being 339 KB When I use FolderItem.PhysicalFileTotalLengthMBS, the

Re: [MBS] Matching File Size as Shown in Finder

2013-04-22 Thread Christian Schmitz
On 22.04.2013, at 20:17, Steve Upton up...@chromix.com wrote: I didn't realize there was also a FolderItem.LogicalFileTotalLengthMBS function. When I use this function I am getting the same sizes as reported by the Finder. Makes sense. The Finder will display the amount of space a

Re: [MBS] Matching File Size as Shown in Finder

2013-04-21 Thread Marnaud
Le 21 avr. 2013 à 7:49, Christian Schmitz a écrit: On 21.04.2013, at 03:21, Scott Crick li...@searchwaresolutions.com 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

Re: [MBS] Matching File Size as Shown in Finder

2013-04-21 Thread Scott Crick
On Apr 20, 2013, at 8:21 PM, Scott Crick li...@searchwaresolutions.com wrote: For example, I have a PDF file that, in the Finder, shows as being 339 KB When I use FolderItem.PhysicalFileTotalLengthMBS, the size of this file is returned as 331776 bytes. When I divide this by 1024, I get 324

Re: [MBS] Matching File Size as Shown in Finder

2013-04-21 Thread Tim Jones
From what I see in my shell tests, it appears that Finder reports the ls -leO size divided by 1000 (for K) divided by 1000 again for M divided by 1000 again for G and then rounds up to 2 decimal places. for example, $ ls -leO /Volumes/VD\ 1/OSX-10.8.iso -rw-r--r-- 1 tjones staff -

[MBS] Matching File Size as Shown in Finder

2013-04-20 Thread Scott Crick
I have an application where I need to be able to show the size of a file that same as how it is shown in the Finder. I have tried a few different methods of calculating file sizes and none of them produce results that are consistent with what is displayed in the Finder. For example, I have a

Re: [MBS] Matching File Size as Shown in Finder

2013-04-20 Thread Christian Schmitz
On 21.04.2013, at 03:21, Scott Crick li...@searchwaresolutions.com 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