• 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
Directory Enumeration in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Directory Enumeration in Cocoa


  • Subject: Directory Enumeration in Cocoa
  • From: Rosyna <email@hidden>
  • Date: Fri, 18 Oct 2002 15:18:12 -0700

I wrote an app a while back that tests iteration speeds of different methods and counts the files resulting from it. When doing the BSD and Carbon iteration for a directory, it returns 38735 files. When I do the Cocoa enumeration I get 38710 files.

What is causing the cocoa enumeration to show 25 less files? Did I miss something?

int count=0;
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtPath:@"/Applications/"];
while (file = [enumerator nextObject])
{
BOOL isDirectory=NO;
[[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@",@"/Applications",file] isDirectory:&isDirectory];
if (!isDirectory)
count++;
}
--


Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People
---

Please include any previous correspondence in replies, it helps me remember what we were talking about. Thanks.
_______________________________________________
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.
  • Follow-Ups:
    • Re: Directory Enumeration in Cocoa
      • From: Ondra Cada <email@hidden>
    • Re: Directory Enumeration in Cocoa
      • From: Chris Parker <email@hidden>
References: 
 >Finder contextual menu item? (From: TJ Marbois <email@hidden>)

  • Prev by Date: Re: Finder prefs (was Re: NSLayoutManager vs BBEdit)
  • Next by Date: Rendering Illustrator files
  • Previous by thread: Re: Finder contextual menu item?
  • Next by thread: Re: Directory Enumeration in Cocoa
  • Index(es):
    • Date
    • Thread