UTIs are designed to allow the passing of typed data between applications primarily e.g. the sending of images over the clipboard. As long as the data is tagged with the appropriate UTI, it will be available for consumers who can deal with that type of data.
The application placing the data on the pasteboard is responsible for determining the appropriate UTI(s) that are placed onto the pasteboard.
When you determine the UTI for a file, the operating system gets this from the extension that is used. This is the only source that the operating system uses to determine the UTI when it looks at a file. If there is no extension for the file, it is given the UTI public.data
.
Instead, Mac OS X derives the UTI from other information, primarily—and tragically—from the file name extension.
The UTI is not stored/cached/retained in any form on the file system, except in the form of the file's extension.
The only mechanism that is available other than using the file extension is to use a tool like file
, or it's library libmagic
, that is part of the file program's distribution to interrogate the file to determine it's probable file type.