• 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: Get size of folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get size of folder


  • Subject: Re: Get size of folder
  • From: Charles Srstka <email@hidden>
  • Date: Wed, 19 Aug 2009 02:52:40 -0500

On Aug 18, 2009, at 11:17 PM, PCWiz wrote:

Hi,

I need a good method to find the size of a file or folder exactly as displayed in Finder. I've tried every method I could find on the internet, from using the du shell utility with NSTask to using the Carbon file manager. I need something that will work under heavy load (processing hundreds or thousands of files). The methods I've tried, some of them work but fail under load. Others just don't return a accurate file size, or they work for some files/folders and mess up on others. What's the easiest way to go about doing this?

Just iterate through the folder's contents, adding up the sizes of all the files contained therein, and you'll have the size of the folder.


Charles
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Get size of folder
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >Get size of folder (From: PCWiz <email@hidden>)

  • Prev by Date: NSTableColumn loses 'value' binding when data cell set to NSButtonCell?
  • Next by Date: Re: Get size of folder
  • Previous by thread: Get size of folder
  • Next by thread: Re: Get size of folder
  • Index(es):
    • Date
    • Thread