Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
setUserTags not really setting?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
MacPrawn  
View profile  
 More options Feb 2 2011, 6:39 am
From: MacPrawn <tec...@malus.ca>
Date: Wed, 2 Feb 2011 03:39:54 -0800 (PST)
Local: Wed, Feb 2 2011 6:39 am
Subject: setUserTags not really setting?
Hi everyone - I have a weird one.

I use setUserTags:path: to set some data on a file. No error is
reported. I even traced each line as it executed, everything looks
good. In the debugger, after the call, I can also read the tags back
and get the new values. However, if I fire-up the command line, and
use mdimport to look at the data on that file, the only openmeta data
in there is :EA:kMDItemOMUserTagTime - no :EA:kMDItemOMUserTags or
kOMUserTags...

To make things weirder, at least in my mind, if I move the code that
sets the meta data to another thread
(detachNewThreadSelector:toTarget:withObject:), everything works
fine...

Anyone has any idea why moving the code to a separate thread would
make a difference? Any help greatly appreciated.

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Andersen  
View profile   Translate to Translated (View Original)
 More options Feb 2 2011, 10:29 am
From: Tom Andersen <tom.ander...@gmail.com>
Date: Wed, 2 Feb 2011 10:29:56 -0500
Local: Wed, Feb 2 2011 10:29 am
Subject: Re: setUserTags not really setting?
Hi,

I think that if a file is created or modified, mdimport will import it. If you somehow manage to set tags on the file in the same second, but after mdimport has imported, then all the file mod times check out, since they are only accurate to one second, and it is not imported again.

Or some variation on that. Perhaps setting no tags, then 0.3 seconds later setting real tags?

You can call mdimport on a file with an nstask to force it to rescan,

Just some ideas

Tom

Sent from my iPad

On 2011-02-02, at 6:39 AM, MacPrawn <tec...@malus.ca> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MacPrawn  
View profile  
 More options Feb 2 2011, 11:10 am
From: MacPrawn <tec...@malus.ca>
Date: Wed, 2 Feb 2011 08:10:46 -0800 (PST)
Local: Wed, Feb 2 2011 11:10 am
Subject: Re: setUserTags not really setting?
Thanks Tom - actually quite helpful... I'll try the delayed approach,
see if it helps or not... But your explanation makes sense: spawning a
new thread would porbably delay the code a bit, and that would explain
that...

Thanks!

On Feb 2, 10:29 am, Tom Andersen <tom.ander...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »