• 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: Counting the number of files in a directory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Counting the number of files in a directory


  • Subject: Re: Counting the number of files in a directory
  • From: James Andrews <email@hidden>
  • Date: Mon, 5 Mar 2007 23:15:13 -0500

You can directly call the filesystem via Cocoa and get an NSarray of files/directory, it's not hard to do.

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ Classes/NSFileManager_Class/Reference/Reference.html

James


On Mar 5, 2007, at 11:08 PM, Chris Suter wrote:


On 06/03/2007, at 2:58 PM, dew drops wrote:

Hi everyone,
I assume that one can call unix commands in Cocoa. Is
there a way to count the number of files in a
directory?


Thanks Dew.

You could use FSGetCatalogInfo. Look at valence. It's possible that it won't return the correct value if there are more than 32,767 files in the folder so you should check that if it's important to you.


- Chris

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Counting the number of files in a directory (From: dew drops <email@hidden>)
 >Re: Counting the number of files in a directory (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Counting the number of files in a directory
  • Next by Date: Re: UInt8 > NSString
  • Previous by thread: Re: Counting the number of files in a directory
  • Next by thread: Re: Counting the number of files in a directory
  • Index(es):
    • Date
    • Thread