Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are dynamic UTIs stable?

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?

like image 780
zneak Avatar asked Dec 16 '22 07:12

zneak


2 Answers

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.)

like image 103
codingFriend1 Avatar answered Dec 26 '22 15:12

codingFriend1


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.

like image 35
zneak Avatar answered Dec 26 '22 13:12

zneak