• 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: Size of a bundle (or directory)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Size of a bundle (or directory)


  • Subject: Re: Size of a bundle (or directory)
  • From: Brian Ganninger <email@hidden>
  • Date: Thu, 27 Mar 2003 13:05:34 -0600

NSFileManger is probably your best bet to get the information you're looking
for.

NSDictionary *dictionary = [[NSFileManager defaultManager]
fileAttributesAtPath:bundlePath traverseLink:NO];

NSNumber *bundleSize = [dictionary objectForKey:NSFileSize];

This is untested but should work or give a close stab at getting there.

Hope this helps.

- Brian Gannigner

On 3/27/03 12:34 PM, "Christopher Corbell" <email@hidden>
wrote:

> Given an NSBundle (created with a known path), does anyone know
> of an easy way to determine its total size?
>
> I haven't been able to find this either in the NSBundle API or in
> any POSIX api (total size of a directory's contents).
>
> It's easy to Get Info for this information in the Finder, but I'd
> like to be able to programatically get a number or, at least, a
> line of text from the shell.
>
> Thanks for any help,
> Christopher
> _______________________________________________
> cocoa-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
> Do not post admin requests to the list. They will be ignored.


----
" An Apple a day keeps the PC away."
" Ever notice that Apples fall from the sky while computers get thrown out
Windows?"
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Size of a bundle (or directory)
      • From: Christopher Corbell <email@hidden>
References: 
 >Size of a bundle (or directory) (From: Christopher Corbell <email@hidden>)

  • Prev by Date: Re: Using NSTimer to call the main thread
  • Next by Date: Re: Using NSTimer to call the main thread
  • Previous by thread: Size of a bundle (or directory)
  • Next by thread: Re: Size of a bundle (or directory)
  • Index(es):
    • Date
    • Thread