Re: Not skipping Descendents
Re: Not skipping Descendents
- Subject: Re: Not skipping Descendents
- From: Fritz Anderson <email@hidden>
- Date: Wed, 5 May 2004 13:40:27 -0500
- skipDescendents is described as
Causes the receiver to skip recursion into the most recently obtained
subdirectory.
So I'd guess that it works only as to _sub_directories that the
NSDirectoryEnumerator has _obtained_. You'd have to examine the
enumerator's fileAttributes with each iteration, and see if the
NSFileType key is NSFileTypeDirectory.
In your position, I'd be looking at NSFileManager's
directoryContentsAtPath:.
-- F
On 5 May 2004, at 1:02 PM, email@hidden wrote:
Greetings all i'm using the directory enumerator to populate a users
menu but won't skip descendents am i doing something wrong?
- (void)populateUsersMenu;
{
NSString *file;
NSDirectoryEnumerator *enumerator = [[NSFileManager
defaultManager]
enumeratorAtPath:@"/Users"];
[enumerator skipDescendents];
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
while (file = [enumerator nextObject])
{
[usersArray addObject:file];
NSLog(@"%@",file);
}
[pool release];
--
Fritz Anderson
Consulting Programmer
http://resume.manoverboard.org/
_______________________________________________
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.