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

Re: Directory Enumeration in Cocoa


  • Subject: Re: Directory Enumeration in Cocoa
  • From: Chris Parker <email@hidden>
  • Date: Fri, 18 Oct 2002 15:32:01 -0700

On Friday, October 18, 2002, at 03:18 PM, Rosyna wrote:

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++;
}

That's odd...

Was this on a local volume or on a network/UFS volume? If the latter, I'm surprised that the BSD and Carbon iterations would have the identical count, as the BSD iteration will pick up ._ files, while the Carbon one will not.

I'd be interested to know what the filenames in the target directory looked like - if you don't feel comfortable posting them to the list, please send them to me directly.

.chris

--
Chris Parker
Cocoa Frameworks Engineer
Apple Computer, Inc.
_______________________________________________
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: Rosyna <email@hidden>
References: 
 >Directory Enumeration in Cocoa (From: Rosyna <email@hidden>)

  • Prev by Date: Re: Guidance needed: IrDa
  • Next by Date: Re: Directory Enumeration in Cocoa
  • Previous by thread: Directory Enumeration in Cocoa
  • Next by thread: Re: Directory Enumeration in Cocoa
  • Index(es):
    • Date
    • Thread