Re: getting information on disk usage
Re: getting information on disk usage
- Subject: Re: getting information on disk usage
- From: Starman <email@hidden>
- Date: Sun, 24 Nov 2002 12:53:18 +0100
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.