• 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: Not skipping Descendents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Not skipping Descendents (From: email@hidden)

  • Prev by Date: Re: GLobal Variables and Object
  • Next by Date: Localized Embedded Frameworks
  • Previous by thread: Not skipping Descendents
  • Next by thread: Re: Not skipping Descendents
  • Index(es):
    • Date
    • Thread