• 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: Path to Metadata attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Path to Metadata attributes


  • Subject: Re: Path to Metadata attributes
  • From: Philip Dow <email@hidden>
  • Date: Thu, 15 Dec 2005 19:40:50 +0100

Hi Kaelin,

Thanks. What bit of documentation are you looking at to find these functions?

-Phil

On Dec 15, 2005, at 7:39 PM, Kaelin Colclasure wrote:


On Dec 15, 2005, at 10:31 AM, Philip Dow wrote:

Hiya, I'm looking for a way to grab the spotlight metadata attributes of a file via the file's path. That is, I am already in possession of a url to the local file, and I would like to look up the attributes associated with that file. Querying spotlight seemed one way to go, but a caveat comes with the kMDItemPath attribute: "The value of this attribute can be retrieved, but can't be used in a query or used to sort search results." Can't be used in a query? That's unfortunate.

Is it possible to get the metadata attributes for a file given the complete path to that file?

/*!
@function MDItemCreate
Returns an metadata item for the given path.
@param allocator The CFAllocator which should be used to allocate
memory for the query and its sub-storage. This
parameter may be NULL in which case the current default
CFAllocator is used.
@param path A path to the file for which to create the MDItem.
[[Currently, the path must exist. MDItemRefs may or
may not be uniqued. Use CFEqual() to compare them.]]
@result An MDItemRef, or NULL on failure.
*/
MD_EXPORT MDItemRef MDItemCreate(CFAllocatorRef allocator, CFStringRef path) MD_AVAIL;

Once you have the MDItem you can get its attributes using the usual calls...

HTH,

-- Kaelin



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Path to Metadata attributes
      • From: Kaelin Colclasure <email@hidden>
References: 
 >Path to Metadata attributes (From: Philip Dow <email@hidden>)
 >Re: Path to Metadata attributes (From: Kaelin Colclasure <email@hidden>)

  • Prev by Date: Re: Path to Metadata attributes
  • Next by Date: Re: Path to Metadata attributes
  • Previous by thread: Re: Path to Metadata attributes
  • Next by thread: Re: Path to Metadata attributes
  • Index(es):
    • Date
    • Thread