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

Re: getting information on disk usage


  • Subject: Re: getting information on disk usage
  • From: Alex Reynolds <email@hidden>
  • Date: Sun, 24 Nov 2002 17:20:30 -0500

Thanks -- I missed this method...

-Alex

On Sunday, November 24, 2002, at 06:53 AM, Starman wrote:


On Sunday, November 24, 2002, at 12:00 PM, Alex Reynolds wrote:

I'd like to try to get information about how much space a disk ("newDiskInfoObject") is using at a given time.

I haven't seen anything in NSFileManager to give me this information, so I looked in Carbon classes and saw FSGetVolumeInfo.

With the NSFileManager, you can have informations about the filesystem using :
- (NSDictionary *)fileSystemAttributesAtPath:(NSString *)path

it gives you a dictionary with the following informations :
- NSFileSystemSize
- NSFileSystemFreeSize

Can't you get the space used on a disk with these informations ?

you can also look at POSIX APIs (man statfs) :
int statfs(const char *path, struct statfs *buf);
int fstatfs(int fd, struct statfs *buf);

or maybe look at darwin's sources to see how they implemented 'df'

Starman
_______________________________________________
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.

References: 
 >Re: getting information on disk usage (From: Starman <email@hidden>)

  • Prev by Date: Re: Anti-alias an NSIamgeView
  • Next by Date: Re: multiple componentsSeparatedByString
  • Previous by thread: Re: getting information on disk usage
  • Next by thread: Quick Q
  • Index(es):
    • Date
    • Thread