Re: How to enumerate directory contents?
Re: How to enumerate directory contents?
- Subject: Re: How to enumerate directory contents?
- From: Paul Archibald <email@hidden>
- Date: Thu, 21 Aug 2008 10:05:10 -0700
You make a valid point. I think I will make that change.
This is not really what we actually do. I cut out most of the real
code to keep the example simple. The actual files we are looking for
are machine generated, and the user is not really involved in the
process at this point.
Paul
On Aug 21, 2008, at 9:49 AM, Sean McBride wrote:
On 8/21/08 7:46 AM, Paul Archibald said:
NSString *file;
// Get all of the files in the source directory, loop thru them.
NSEnumerator *files = [[myFileMgr
directoryContentsAtPath:srcDirectory] objectEnumerator];
while(file = [files nextObject] ) {
if( [[file pathExtension] isEqualToString:interestingExtension] ) {
// do something with file
}
You might want to read the docs for "isEqualToString". Using it to
compare file extensions will not behave as the user expects (case
sensitivity, Unicode decomposition, etc.)
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden