• 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 file on disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Size of a file on disk


  • Subject: Re: Size of a file on disk
  • From: Martin Hewitson <email@hidden>
  • Date: Wed, 31 Aug 2011 22:02:03 +0200

Hi Jon,

You can do something like:

    NSFileManager *fm = [NSFileManager defaultManager];
    NSDictionary *fattrs = [fm attributesOfItemAtPath:fullpath error:NULL];
    sizeOnDisk = [fattrs objectForKey:NSFileSize];

Martin

On Aug 31, 2011, at 09:51 PM, Jon Sigman wrote:

> How does one determine the size of a file on disk using Cocoa?
> I've looked at NSFileManager but it doesn't seem to offer any
> methods for finding file attributes.
> OSX 10.6.8
> _______________________________________________
>
> 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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer
    Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: email@hidden
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





_______________________________________________

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

References: 
 >Size of a file on disk (From: Jon Sigman <email@hidden>)

  • Prev by Date: Re: Size of a file on disk
  • Next by Date: Re: LLVM 2.1 Error
  • Previous by thread: Re: Size of a file on disk
  • Next by thread: Re: Size of a file on disk
  • Index(es):
    • Date
    • Thread