On Fri, 29 Jul 2011 09:09:43 -0700, Wade Tregaskis said:

>> Further to earlier answers, bear in mind you've got no guarantee that
>file extensions are correct, or even exist. Plus of course, you might
>have both .jpg and .jpeg. You might well be better iterating through,
>finding the UTI of each file, and working from that.
>
>Oooh, that's kind of embarrassing. :)  Yes, that's a very good point,
>that we all should have realised before worrying about the details of
>file extension comparison.  So I'll retract my prior recommendations and
>instead suggest using something like:

Indeed file extensions are lame and fragile, and may not even be present.

But UTIs are not perfect either.  For one, the OS derives them primarily from 
the file extension anyway (though also from HFS type), which means they fail 
horribly for common extensions used by multiple formats.  ex: ".img" is used by 
many formats (sadly).  Ask the OS what the UTI of a .img file is, and you'll 
get different answers on different computers, depending which apps are 
installed and declare a UTI for that extension.

So the OP may be better dealing with extensions directly, depending.

--
____________________________________________________________
Sean McBride, B. Eng                 s...@rogue-research.com
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to