Skip navigation.
 
mlRe: Obtain directory size.
FROM : Jim Correia
DATE : Fri May 20 19:00:29 2005

On May 20, 2005, at 12:50 PM, Jim Correia wrote:

> On May 20, 2005, at 12:09 PM, Julian wrote:
>
>

>> Since NSFileManager has no capabilities of returning the size of a 
>> folder(a folder + contents), what would be a suitable & fast 
>> method for obtaining this besides enumerating as it's slow as 
>> christmas. I am looking for perhaps a carbon call to get this in 
>> one swoop.
>>

>
> For a directory, call FSGetCatalogInfo, and ask for the valence.
>
> Heed the warning about the cost of computing this for volume 
> formats which don't natively store this information.
>
> <http://developer.apple.com/documentation/Carbon/Reference/

> File_Manager/file_manager/chapter_1.5_section_29.html>

I think I may have mis-interpreted your question. I thought you 
wanted to know how many files+folders were contained in a folder. If 
you want to know how much space (logical or physical) they take on 
disk, iterating (using on API set or another) is your only option.

Jim

Related mailsAuthorDate
mlObtain directory size. Julian May 20, 18:09
mlRe: Obtain directory size. Brian Bergstrand May 20, 18:42
mlRe: Obtain directory size. Daniel Jalkut May 20, 18:42
mlRe: Obtain directory size. Jim Correia May 20, 18:50
mlRe: Obtain directory size. Chris Parker May 20, 19:00
mlRe: Obtain directory size. Jim Correia May 20, 19:00
mlRe: Obtain directory size. James Bucanek May 20, 19:20
mlRe: Obtain directory size. Julian May 20, 19:22
mlRe: Obtain directory size. Daniel Jalkut May 20, 19:57
mlRe: Obtain directory size. J.M.Brough May 20, 20:06
mlRe: Obtain directory size. Rosyna May 21, 01:26
mlRe: Obtain directory size. Steve Christensen May 21, 01:27