How to find file types in objective c -
i have done lot of research on , haven't found useful. want making simple program in objective c personal use opens files , gives information them. problem have encountered cannot find file of file opening. without looking @ extension, there way find full file format of file in objective c?
if possible, able save file in different format. information on subject important application. appreciated.
mac os x has type information attached each file specifies type of file supposed be. information given application last saved file, not correct. also, new versions of os x ignore information , go entirely off of file extension. however, information still stored , can retrieved using nsfilemanager's attributesofitematpath:error:
method.
as mentioned quixoto above, os x maps extensions utis. uti of file can retrieved using nsworkspace, can tell uti means. code localized description of file @ /full/path/to/file
:
nsworkspace *ws = [nsworkspace sharedworkspace]; nsstring *description = [ws localizeddescriptionfortype:[ws typeoffile:@"/full/path/to/file" error:nil]];
the typeoffile:error:
method requires absolute path.
Comments
Post a Comment