• 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: Obtaining the size of a directory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obtaining the size of a directory


  • Subject: Re: Obtaining the size of a directory
  • From: Dominik Freyer <email@hidden>
  • Date: Mon, 18 Oct 2004 14:15:46 +0200

That sounds pretty good. I think I'll go this way and take the little work of implementing this. Thanks.


Am 18.10.2004 um 14:05 schrieb Daniel Todd Currie:

I'm no expert on this sort of thing, but I wrote an app that dumped equations to the command-line app "bc" a few hundred times per second. I had no trouble with it, so I would assume that if the savings in using du-hs are significant, that using the NSTask would be the way to go.

-- DTC


On 2004 Oct 18, at 20:49, Dominik Freyer wrote:

Hm, that would be the worst way. In the meantime I found a BSD Command 'du -hs' which can give me very fast the correct directory size. Can I use it as an NSTask efficiently?


Am 18.10.2004 um 13:04 schrieb Daniel Todd Currie:

To the best of my knowledge, you'll have to traverse the entire file tree within that directory. This is why it takes a while to calculate folder sizes in Finder.app when you first turn on folder size calculation.

-- DTC


On 2004 Oct 18, at 17:40, Dominik Freyer wrote:

Hi there,
I'm sure this question has been posted before, but I couldn't find a satisfacting answer anywhere. I'm buidling an application which has to go through a lot of Directories and get their sizes. I tried to use the fileAttributesAtPath method from the Filemanager (and the fileSize method to get it). It works perfectly for files but not for directories.
It seems to me, that the NSFilemanager doesn't count the sizes of the dircontents but shows something like a internal size information. Probably to safe time, I'm not sure. Any idea to get the dir-sizes fast und correct?
Best regards
Dominik

_______________________________________________
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



_______________________________________________
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


_______________________________________________
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



_______________________________________________
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


_______________________________________________
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: 
 >Obtaining the size of a directory (From: Dominik Freyer <email@hidden>)
 >Re: Obtaining the size of a directory (From: Daniel Todd Currie <email@hidden>)
 >Re: Obtaining the size of a directory (From: Dominik Freyer <email@hidden>)
 >Re: Obtaining the size of a directory (From: Daniel Todd Currie <email@hidden>)

  • Prev by Date: Pasteboards
  • Next by Date: Re: Obtaining the size of a directory
  • Previous by thread: Re: Obtaining the size of a directory
  • Next by thread: Re: Obtaining the size of a directory
  • Index(es):
    • Date
    • Thread