Are dynamic UTIs stable?

心已入冬 提交于 2021-02-19 04:19:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!