Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SLOW -[NSFileManager directoryContentsAtPath:matchingExtension:options:keepExtension:]



In that case I suggest you use an FSIterator with FSGetCatalogInfoBulk(). There have been quite a few posts on this subject on this list. Search the archives for FSGetCatalogInfoBulk(). FSGetCatalogInfoBulk() is probably the fastest method for directory enumeration if you need any kind of metadata about the file (name, directory, permissions, whatever).

Conversely, directoryContentsAtPath is probably the slowest method to enumerate directories.

Ack, at 4/11/06, Pierre Bernard said:

I call it as a reaction to a user selecting a file or a directory. I list its siblings.

The list may be very long. I for one always have many items in the trash. When I hit that I am in for 10-20 seconds of beachball.

You may see this method in action in the Apple provided sample code: SimpleBrowser. You will see that it is way slower to browse the file system than the Finder is.

--


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

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >SLOW -[NSFileManager directoryContentsAtPath:matchingExtension:options:keepExtension:] (From: Pierre Bernard <email@hidden>)
 >Re: SLOW -[NSFileManager directoryContentsAtPath:matchingExtension:options:keepExtension:] (From: j o a r <email@hidden>)
 >Re: SLOW -[NSFileManager directoryContentsAtPath:matchingExtension:options:keepExtension:] (From: Pierre Bernard <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.