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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/mikey-san %40bungie.org

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to