Re: UTI for Mach-O file
Re: UTI for Mach-O file
- Subject: Re: UTI for Mach-O file
- From: Ken Thomases <email@hidden>
- Date: Wed, 25 Aug 2010 15:12:47 -0500
On Aug 25, 2010, at 12:46 PM, John Johnson wrote:
> Hello. I'm implementing an NSDocument-based utility that loads mach-o files and displays information about them. But no matter what UTI I put in the Info.plist, I can't get the app to recognize the file when dropped on the dock tile. The only way I could get it recognized is by having no UTI and a * for the extensions, but this has the (very) unfortunate side-effect of recognizing ALL files. I've tried com.apple.mach-o.binary and public.unix-executable as well as public.executable. It's curious, because running mdls shown no UTI for an executable...
> Can anyone tell me the best way to go from here, so that my app recognizes ONLY mach-o files? Is UTI's even the best way to go?
UTIs are associated to files using only file metadata (the extension part of the filename or the HFS type code) to identify files. The OS does not inspect the file contents (as the "file" command does, using the "magic" database).
That's why mdls doesn't list a UTI.
Things with known file extensions, like a .dylib file, would have a UTI.
So, you can't use UTIs for what you're trying to do.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden