Number of Files on Volume
Number of Files on Volume
- Subject: Number of Files on Volume
- From: Joe Turner <email@hidden>
- Date: Tue, 25 Nov 2008 18:44:12 -0600
I have ben trying to find a good way to get an accurate count of files
on a Volume. Using a NSDirectoryEnumerator takes way too long (a
couples minutes), so, I figured out how to do it on the old Carbon
FileManager using:
FSVolumeInfo info;
FSRef pathRef;
FSCatalogInfo catInfo;
const char *inPath = [volumePath
cStringUsingEncoding:NSUTF8StringEncoding];
FSPathMakeRef((UInt8 *)inPath, &pathRef, NULL);
FSGetCatalogInfo(&pathRef, kFSCatInfoGettableInfo, &catInfo, NULL,
NULL, NULL);
FSGetVolumeInfo(catInfo.volume, 0, NULL, kFSVolInfoGettableInfo,
&info, NULL, NULL);
self.count = [NSNumber numberWithInt:info.fileCount];
Is there a better way of doing it? Maybe with Cocoa tools?
Thanks
_______________________________________________
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