• 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: getting free space available in a drive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting free space available in a drive


  • Subject: Re: getting free space available in a drive
  • From: Michael Watson <email@hidden>
  • Date: Thu, 19 Jun 2008 03:29:26 -0400

There are two NSFileManager methods for this:

10.4.11 and earlier: -[NSFileManager fileSystemAttributesAtPath:]

10.5 and later: -[NSFileManager attributesOfFileSystemForPath:error:]

Each returns an NSDictionary containing a NSFileSystemFreeSize key. The value for this key is an NSNumber that represents the number of free bytes on the file system.

If you want to get gritty, use statfs() and multiply f_bfree (blocks free) by f_bsize (block size for the file system).


-- m-s

On 19 Jun, 2008, at 02:44, Angelo Chen wrote:

Hi,

how to get the total free space available in a drive? thanks,

Angelo

_______________________________________
YM - 離線訊息
就算你沒有上網,你的朋友仍可以留下訊息 給你,當你上網時就能立即看到,任何說話都冇走失。
http://messenger.yahoo.com.hk
_______________________________________________


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:
@bungie.org


This email sent to email@hidden

_______________________________________________

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: 
 >getting free space available in a drive (From: Angelo Chen <email@hidden>)

  • Prev by Date: Re: Problem with NSWindow setFrame
  • Next by Date: Re: Tab-based ("document"-based?) application
  • Previous by thread: getting free space available in a drive
  • Next by thread: Problem with NSWindow setFrame
  • Index(es):
    • Date
    • Thread