• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Plain Text UTI Madness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plain Text UTI Madness


  • Subject: Re: Plain Text UTI Madness
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 28 Jan 2009 21:34:42 -0500

Seth Willits (email@hidden) on 2009-01-28 8:56 PM said:

>I'm trying to get this NSOpenPanel to select all plain text files.
>This should be *simple* right? Sheesh. So I thought I'd use a UTI (in
>addition to some specific extensions and the HFS type 'TEXT'), so I
>added kUTTypePlainText. That really should be just dandy for my needs.
>
>Except it's not.
>
>I have a file without an extension, which in Finder is shown as "Plain
>text", has kMDItemKind = "Plain text", and yet kMDItemContentType is
>"public.data" -- what gives? Why is it a plain text "kind" of file,
>but not public.plain-text?

Does this extension-less file have an HFS type?

If not, UTIs won't help you.  The OS currently derives a file's UTI by
examining:
 a) its extension
 b) its HFS type
 c) its MIME type

Note the HFS creator is not consulted, nor is the file's contents.

So if you have no extension and no HFS type, I dunno which UTI you'll
get.  Probably public.data, from what you say.

"Plain Text" seems to be the Finder's catch all.  Try this: 'touch /
foo', then Get Info on that file.  It's "Plain Text".

Sean


_______________________________________________

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

  • Follow-Ups:
    • Re: Plain Text UTI Madness
      • From: Seth Willits <email@hidden>
References: 
 >Plain Text UTI Madness (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: Detecting Initialization
  • Next by Date: Re: setIntercellSpacing
  • Previous by thread: Plain Text UTI Madness
  • Next by thread: Re: Plain Text UTI Madness
  • Index(es):
    • Date
    • Thread