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: Canonical way of determining file type




On Nov 29, 2005, at 12:31 PM, Christopher Linn wrote:

On Nov 29, 2005, at 12:09 PM, Bryan Prusha wrote:
On Nov 25, 2005, at 9:51 PM, Eric Schlegel wrote:
On Nov 25, 2005, at 1:15 AM, Jerry wrote:
Tiger and later: call LSCopyItemAttribute and pass kLSItemContentType.
Pre-Tiger: perhaps 2, but I don't know for sure.

Is this a good way to filter files in a Navigation dialog? I've noticed that our filtering code is the last place we ever use FSSpecs because we can look at the extension of the file without having to do any filesystem operations.

Yes, it is the preferred way to filter files. In Tiger and later, NavServices actually offers built-in support for filtering files by UTI. I believe there's a technote that describes how to write a NavServices filter function that uses LaunchServices and UTIs to filter files, also.

Actually, files can be filtered via UTI on Panther as well via a custom filter proc. Panther Nav doesn't have any built in support for them tho.

Caveat: I don't recommend this approach for Panther. There are far fewer UTIs declared on Panther, so most file extensions and file type codes do not map to a UTI. UTIs declared in Panther were all about pasteboard types. Tiger is where Apple really added UTI declarations for many common file types.

True, but if the client is only filtering on their own types declared in their plist this shouldn't be an issue.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden


This email sent to email@hidden
References: 
 >Canonical way of determining file type (From: Glen Low <email@hidden>)
 >Re: Canonical way of determining file type (From: Eric Schlegel <email@hidden>)
 >Re: Canonical way of determining file type (From: Jerry <email@hidden>)
 >Re: Canonical way of determining file type (From: Eric Schlegel <email@hidden>)
 >Re: Canonical way of determining file type (From: Bryan Prusha <email@hidden>)
 >Re: Canonical way of determining file type (From: Christopher Linn <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.