Skip navigation.
 
mlRe: getting information on disk usage
FROM : Starman
DATE : Sun Nov 24 12:53:18 2002

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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlgetting information on disk usage Alex Reynolds Nov 24, 12:00
mlRe: getting information on disk usage Starman Nov 24, 12:53
mlRe: getting information on disk usage Alex Reynolds Nov 24, 23:20