Directory Enumeration in Cocoa
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.