Categories
Mac OS

UTI quick check of a file

When carrying out the development of iOS macOS,We often need to interact and file,For example, association and open a certain type of file,Well, this time,Your name suffix used in this document are not,But it's UTI。

UTI is a unified file type name,It sets out what should be a file type,Rather than suffixes to determine,For example, txt,text,json are plain text files,They are public.text

Then,usually,For the well-known file types,You can go toApple's official pageView the list,Here we show the most common extensions should correspond to the UTI for you。

But these are only a small part,There are many known file suffix does not exist in this list among,such as .plist ,Then,We want to how to do it? Themselves to declare it?

Obviously,Declared himself a common suffix is ​​the existence of hidden,Then,You can use the command line tools on macOS to determine the file type。

First of all,You need to have a .plist file,Then you can execute the following command:

This type of tree can get the file,The topmost is its type。

The results you get are as follows:

Then clearly, with.apple.property-list It is .plist Of the UTI。

References

Original article written by Gerber drop-off:R0uter's Blog » UTI quick check of a file

Reproduced Please keep the source and description link:https://www.logcg.com/archives/3017.html

By R0uter's Blog

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Leave a Reply

Your email address will not be published. Required fields are marked *