• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Obtain directory size.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obtain directory size.


  • Subject: Re: Obtain directory size.
  • From: James Bucanek <email@hidden>
  • Date: Fri, 20 May 2005 10:20:20 -0700

Julian wrote on Friday, May 20, 2005:
>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.

There isn't one.

The OS doesn't track this information, which is why there is no API to get it "in one swoop."

The quickest way of doing this, as far as I know, is to use FSGetCatalogInfoBulk to recursively fetch all of the data and resource fork lengths for every file in the subdirectory.  Set the catalog info flags so the file lengths are the only information returned (since you don't care about anything else, there's no point in having FSGetCatalogInfoBulk fetch/calculate any other file info values).

--
James Bucanek <mailto:email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Obtain directory size. (From: Julian <email@hidden>)

  • Prev by Date: Re: FSMountServerVolumeSync, AFP volumes and Tiger
  • Next by Date: Re: Obtain directory size.
  • Previous by thread: Re: Obtain directory size.
  • Next by thread: Re: Obtain directory size.
  • Index(es):
    • Date
    • Thread