Re: How to enumerate directory contents?
Re: How to enumerate directory contents?
- Subject: Re: How to enumerate directory contents?
- From: "Sean McBride" <email@hidden>
- Date: Thu, 21 Aug 2008 12:49:58 -0400
- Organization: Rogue Research
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