FROM : Julian
DATE : Fri May 20 19:22:11 2005
Yes, what I was looking for was total size in bytes of a folder + all
contents. Using Daniels, fastFolderSizeAtFSRef now makes me realize
just how slow NSDirectoryEnumerator really is. :-)
Thanks
On May 20, 2005, at 1:00 PM, Chris Parker wrote:
>
> On May 20, 2005, at 9:50 AM, 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>
>>
>
> The valence is just the *number* of items contained in the
> directory. I believe the original poster was asking for total size
> in terms of bytes on disk contained in the folder.
>
> NSFileManager & NSDirectoryEnumerator use FSIterators (indirectly)
> to do their work, but we don't (yet) allow only specific attributes
> to be returned from the -directoryAttributes or -fileAttributes
> calls. There's an enhancement request for that already, but I
> believe if you want this information you're going to have to walk
> the file structure somehow.
>
> .chris
>
> --
> Chris Parker
> Cocoa Frameworks
> Apple Computer, Inc.
>
>
DATE : Fri May 20 19:22:11 2005
Yes, what I was looking for was total size in bytes of a folder + all
contents. Using Daniels, fastFolderSizeAtFSRef now makes me realize
just how slow NSDirectoryEnumerator really is. :-)
Thanks
On May 20, 2005, at 1:00 PM, Chris Parker wrote:
>
> On May 20, 2005, at 9:50 AM, 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>
>>
>
> The valence is just the *number* of items contained in the
> directory. I believe the original poster was asking for total size
> in terms of bytes on disk contained in the folder.
>
> NSFileManager & NSDirectoryEnumerator use FSIterators (indirectly)
> to do their work, but we don't (yet) allow only specific attributes
> to be returned from the -directoryAttributes or -fileAttributes
> calls. There's an enhancement request for that already, but I
> believe if you want this information you're going to have to walk
> the file structure somehow.
>
> .chris
>
> --
> Chris Parker
> Cocoa Frameworks
> Apple Computer, Inc.
>
>
| Related mails | Author | Date |
|---|---|---|
| Julian | May 20, 18:09 | |
| Brian Bergstrand | May 20, 18:42 | |
| Daniel Jalkut | May 20, 18:42 | |
| Jim Correia | May 20, 18:50 | |
| Chris Parker | May 20, 19:00 | |
| Jim Correia | May 20, 19:00 | |
| James Bucanek | May 20, 19:20 | |
| Julian | May 20, 19:22 | |
| Daniel Jalkut | May 20, 19:57 | |
| J.M.Brough | May 20, 20:06 | |
| Rosyna | May 21, 01:26 | |
| Steve Christensen | May 21, 01:27 |






Cocoa mail archive

