How do you get the Finder “Kind” for a file?

旧城冷巷雨未停 提交于 2019-12-07 03:12:26

Try LSCopyKindStringForURL, passing the file URL.

I was able to get a string for the type of a .css file with typeOfFile:error: followed by localizedDescriptionForType:, but the string wasn't "CSS style sheet" like you wanted, it was "Dashcode CSS Document". Some other examples of other extensions:

ext      typeOfFile                    localizedDescriptionForType
------------------------------------------------------------------
.css     com.apple.dashcode.css        Dashcode CSS Document
.php     public.php-script             PHP script
.html    public.html                   HTML text
.txt     public.plain-text             text
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!