问题
I have files of a format that has no declared UTI, so Launch Services has assigned to it a dynamic UTI (dyn.ah62d4rv4ge81g23wsmw1a5dbte
). I have no control over the UTI of these documents.
It also happens that I would like to develop a Quick Look generator for that format, and that Quick Look generators only rely on the document UTI, and will ignore any other kind of document identification present in their property list (such as the creator code and the extension).
Is it safe for me to use the dynamic UTI until the developer adds one? Are those generated by a stable algorithm that has good chances of returning the same UTI for the same files on another machine?
回答1:
Yes, dynamic UTIs are stable and even include information about the file content. Actually the random looking code after 'dyn.' is a base 32 encoding of the known type information.
This article by Alastair Houghton explains that in detail. (Unfortunately this was written several months after you posted your question :-) But it might help others.)
回答2:
Dynamic UTIs are apparently generated in a deterministic way that makes them viable identifiers across different Macs.
So, it's safe to use a dynamic UTI for plugin bundles.
来源:https://stackoverflow.com/questions/8003919/are-dynamic-utis-stable