• 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
Number of Files on Volume
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Number of Files on Volume
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Do I need Custom View inside a hud panel to drag-n-drop images ??
  • Next by Date: Re: Chapters in Hillegass to skip on first reading?
  • Previous by thread: Do I need Custom View inside a hud panel to drag-n-drop images ??
  • Next by thread: Re: Number of Files on Volume
  • Index(es):
    • Date
    • Thread